X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8C02CD1ECB1 for ; Wed, 24 Mar 2004 02:34:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 48134-03 for ; Tue, 23 Mar 2004 22:34:53 -0400 (AST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by svr1.postgresql.org (Postfix) with ESMTP id 0DB3FD1ECA5 for ; Tue, 23 Mar 2004 22:34:49 -0400 (AST) Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1B5yEG-0007Vl-00 for ; Wed, 24 Mar 2004 03:34:52 +0100 Received: from 24-151-240-198.chartertn.net ([24.151.240.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2004 03:34:52 +0100 Received: from dbase4 by 24-151-240-198.chartertn.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2004 03:34:52 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-odbc@postgresql.org From: "David P. Lurie" Subject: Re: postgresql equivalent to ms access parameter query Date: Tue, 23 Mar 2004 21:34:49 -0500 Lines: 32 Message-ID: References: <20040323152604.94169.qmail@web20801.mail.yahoo.com> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 24-151-240-198.chartertn.net X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/74 X-Sequence-Number: 3876 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