Re: postgresql equivalent to ms access parameter query - Mailing list pgsql-odbc

From David P. Lurie
Subject Re: postgresql equivalent to ms access parameter query
Date
Msg-id c3qs49$pni$1@sea.gmane.org
Whole thread Raw
In response to postgresql equivalent to ms access parameter query  ("David P. Lurie" <dbase4@hotmail.com>)
List 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




pgsql-odbc by date:

Previous
From: "David P. Lurie"
Date:
Subject: Re: postgresql equivalent to ms access parameter query
Next
From: Jeff Eckermann
Date:
Subject: Re: postgresql equivalent to ms access parameter query