vb6 inquiry

From: Joseph Armbruster <josepharmbruster(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: vb6 inquiry
Date: 2005-10-12 19:34:58
Message-ID: 938f42d70510121234m121a622ahe934c1ea9c22587d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

All,

I am working off of the vb6 sample given in the psqlODBC doc that
accompanies the odbc driver. My issue is, when I am displaying the
rs.Cursortype, it is reading 3, however this is not what was requested.
Shouldn't this be 2?

Thank You,
Joseph Armbruster

Dim cn As New adodb.Connection
Dim rs As New adodb.Recordset

cn.Open "DSN=test_post;UID=postgres;PWD=acupostgres;Database=vbtest"

rs.CursorType = adOpenDynamic
rs.LockType = adLockOptimistic
rs.CursorLocation = adUseServer
rs.Open "SELECT id, data FROM vbtest", cn, adOpenDynamic, adLockOptimistic

MsgBox "AdoEnums.CursorType.DYNAMIC = " & adodb.CursorTypeEnum.adOpenDynamic
MsgBox "rs.CursorType = " & rs.CursorType & vbCrLf & "rs.CursorLocation = "
& rs.CursorLocation

While Not rs.EOF
Debug.Print rs!id & ": " & rs!Data
rs.MoveNext
Wend

rs.AddNew
rs!id = 76
rs!Data = "More random data"

rs.Update

cn.Execute "INSERT INTO vbtest (id, data) VALUES (23, 'Some random data');"
rs.Update

If rs.State <> adStateClosed Then rs.Close
Set rs = Nothing
If cn.State <> adStateClosed Then cn.Close
Set cn = Nothing

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Victor Rivero 2005-10-13 01:03:47 Re: Problem with psqlODBC on "Cache Size"
Previous Message Merlin Moncure 2005-10-12 16:06:22 Re: lock - feedback