Re: Postgre and Visual Basic
От | Adnan DURSUN |
---|---|
Тема | Re: Postgre and Visual Basic |
Дата | |
Msg-id | BAY106-DAV200D06F5A485EBF7F81087FAEE0@phx.gbl обсуждение исходный текст |
Ответ на | Postgre and Visual Basic (dodol garut <jangkaru80@yahoo.com>) |
Список | pgsql-odbc |
----- Original Message -----From: dodol garutSent: Tuesday, March 07, 2006 4:47 PMSubject: [ODBC] Postgre and Visual Basic>i need a sample of Visual Basic Project with PostgreSQL, anyone can help me?>Trim'sThis Sample function make a connection to database :
-------------------------------------------------------------------------------------Public Function SystemLogon() As String
Dim MyConn As New ADODB.Connection, myDSN As String, Rs As Object
On Error GoTo Hata
MyConn.Open "Provider=MSDASQL.1;Password=" & ConnSifre & ";Persist Security Info=True;UID=" & ConnUser & ";Data Source=" & ConnDataSource & ";DATABASE=" & ConnDataBase & ";SERVER=" & ConnServer & ""
Set SetMyConn = MyConn
SystemLogon = ""Exit Function
Hata:
SystemLogon = MyConn.Errors(0).Description
End FunctionThis Sample function executes a string (update,insert,delete) and returns number of effected rows :
------------------------------------------------------------------------------------Public Function ExecuteSQL(pSQLStr As String) As Long
Dim AffectedRecords As Long
MyCurConn.Execute pSQLStr, AffectedRecords, adCmdText
ExecuteSQL = AffectedRecords
End FunctionThis Sample function executes a string (select) and returns a ADODB.recordset :-----------------------------------------------------------------------------------------------------------------------
Public Function ExecuteSQLReturnRowSet(pSQLStr As String) As ADODB.Recordset
Dim MyRs As ADODB.Recordset
Set MyRs = New ADODB.RecordsetMyRs.CursorLocation = adUseClient
MyRs.Open pSQLStr, MyCurConn, adOpenStatic, adLockReadOnly
Set ExecuteSQLReturnRowSet = MyRs
Set MyRs = Nothing
End FunctionI hope above samples helps to you...Adnan DURSUN
ASRIN Bilişim Ltd.TURKEY
В списке pgsql-odbc по дате отправления: