X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3D5B147580B for ; Wed, 19 Feb 2003 04:58:12 -0500 (EST) Received: from mailhub1.otago.ac.nz (mailhub1.otago.ac.nz [139.80.64.218]) by postgresql.org (Postfix) with ESMTP id 2B024475458 for ; Wed, 19 Feb 2003 04:58:11 -0500 (EST) Received: (from root@localhost) by mailhub1.otago.ac.nz (8.12.7/8.12.7) id h1J9vcHv017646; Wed, 19 Feb 2003 22:57:38 +1300 Received: from psy.otago.ac.nz (psy.otago.ac.nz [139.80.61.25]) by mailhub1.otago.ac.nz (8.12.7/8.12.7) with ESMTP id h1J9vaUN017554; Wed, 19 Feb 2003 22:57:36 +1300 Received: from gwain (GWAIN.psy.otago.ac.nz [172.20.240.27]) by psy.otago.ac.nz (8.9.3/8.9.3) with ESMTP id WAA06240; Wed, 19 Feb 2003 22:57:36 +1300 From: "Mike Miller" To: , Subject: Re: VB functions for postgres Date: Wed, 19 Feb 2003 22:57:34 +1300 Message-ID: <000001c2d7fd$543c7060$1bf014ac@gwain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 Importance: Normal In-Reply-To: <1028.202.8.228.70.1045646947.squirrel@202.91.162.53> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-scanner: scanned by Inflex 1.0.12.4 - (http://pldaniels.com/inflex/) X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/88 X-Sequence-Number: 2706 -----Original Message----- > MyConn.Open "DSN=PostgreSQL", "Mondi", "1234" > Set rs = New ADODB.Recordset > rs.Open "select * from userinfo;", Myconn, adOpenDynamic > then I use the Myconn.execute to execute some sql querries > > Heres the prob: > - I don't know how to navigate thru the recordset Try something like this. It will get you started ;) Write back if you have trouble. Set rsInfo = New ADODB.Recordset With rsInfo .CursorType = adOpenStatic .LockType = adLockReadOnly .ActiveConnection = adoConnection .Open "select Name, Description from userinfo" ' Make sure there are records If Not .BOF And Not .EOF Then ' Move to the first record .MoveFirst ' While not at the end (there are more records) While Not .EOF ' Do stuff with row Debug.Print .Fields("Name").Value Debug.Print .Fields("Description").Value ' DoEvents so that app doesn't hang and move to the next record DoEvents .MoveNext Wend End If ' Close the recordset .Close End With -- Mike Miller, Computer Programmer, Department of Pyschology, University Of Otago mike@psy.otago.ac.nz +64 3 479 5402 ...when you lay awake at night hoping that those elves from "The Elves and the Shoemaker" know where you work and can program in C++ as well as they can sew together sandles... -- stolen from (http://www.gameai.com/youknow.html)