pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David P. Lurie <dbase4@hotmail.com>
To: pgsql-odbc@postgresql.org
Subject: Re: postgresql equivalent to ms access parameter query
Date: Tue, 23 Mar 2004 21:34:49 -0500
Message-ID: <c3qs49$pni$1@sea.gmane.org> (raw)
References: <c3ouup$n9p$1@sea.gmane.org>
	<20040323152604.94169.qmail@web20801.mail.yahoo.com>
	<c3qoc6$jaq$1@sea.gmane.org>

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







view thread (5+ messages)  latest in thread

Message-ID: <c3qs49$pni$1@sea.gmane.org>
Permalink:  ../c3qs49$pni$1@sea.gmane.org/
Also on:    postgresql.org/message-id/c3qs49$pni$1@sea.gmane.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: dbase4@hotmail.com
  Subject: Re: postgresql equivalent to ms access parameter query
  In-Reply-To: <c3qs49$pni$1@sea.gmane.org>
  References: <c3ouup$n9p$1@sea.gmane.org> <20040323152604.94169.qmail@web20801.mail.yahoo.com> <c3qoc6$jaq$1@sea.gmane.org> <c3qs49$pni$1@sea.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox