From: Mike Miller <mike@psy.otago.ac.nz>
To: raymond.chuasing@kasal.com
To: pgsql-odbc@postgresql.org
Subject: Re: VB functions for postgres
Date: Wed, 19 Feb 2003 22:57:34 +1300
Message-ID: <000001c2d7fd$543c7060$1bf014ac@gwain> (raw)
In-Reply-To: <1028.202.8.228.70.1045646947.squirrel@202.91.162.53>
-----Original Message-----
<SNIP>
> 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)
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: mike@psy.otago.ac.nz, raymond.chuasing@kasal.com
Subject: Re: VB functions for postgres
In-Reply-To: <000001c2d7fd$543c7060$1bf014ac@gwain>
References: <1028.202.8.228.70.1045646947.squirrel@202.91.162.53> <000001c2d7fd$543c7060$1bf014ac@gwain>
* 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