Skip site navigation (1) Skip section navigation (2)

Re: postgresql equivalent to ms access parameter query

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 (view raw or flat)
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





In response to

pgsql-odbc by date

Next:From: Maximilian F├╝hrerDate: 2004-03-24 09:59:25
Subject: Performance-problem
Previous:From: David P. LurieDate: 2004-03-24 01:31:04
Subject: Re: postgresql equivalent to ms access parameter query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group