From: | "David P(dot) Lurie" <dbase4(at)hotmail(dot)com> |
---|---|
To: | pgsql-odbc(at)postgresql(dot)org |
Subject: | Re: postgresql equivalent to ms access parameter query |
Date: | 2004-03-24 02:34:49 |
Message-ID: | c3qs49$pni$1@sea.gmane.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
Got a code snippet to work by modifying a module from Chapter 2 in
"Programming MS Access 2002". Didn't realize that the recordset string had
to be an SQL statement like SELECT rather than a table or view name:
Sub OpenMyDB()
Dim cnn1 As New Connection
Dim rst1 As Recordset
'Create the connection.
cnn1.Open "DSN=PostgreSQL30;" & _
"Database=test;"
'Create recordset reference, and set its properties.
Set rst1 = New ADODB.Recordset
rst1.CursorType = adOpenKeyset
rst1.LockType = adLockOptimistic
'Open recordset, and print a test record.
rst1.Open "select * from public.stores;", cnn1
Debug.Print rst1.Fields(0).Value, rst1.Fields(1).Value,
rst1.Fields(2).Value; rst1.Fields(3).Value; rst1.Fields(4).Value;
'Clean up objects.
rst1.Close
cnn1.Close
Set rst1 = Nothing
Set cnn1 = Nothing
End Sub
From | Date | Subject | |
---|---|---|---|
Next Message | Maximilian Führer | 2004-03-24 09:59:25 | Performance-problem |
Previous Message | David P. Lurie | 2004-03-24 01:31:04 | Re: postgresql equivalent to ms access parameter query |