vb6 inquiry - Mailing list pgsql-odbc

From Joseph Armbruster
Subject vb6 inquiry
Date
Msg-id 938f42d70510121234m121a622ahe934c1ea9c22587d@mail.gmail.com
Whole thread Raw
Responses Re: vb6 inquiry
List 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

pgsql-odbc by date:

Previous
From: Chris Hoover
Date:
Subject: Re: Problems compiling odbc
Next
From: "Ben Trewern"
Date:
Subject: Re: select a non numeric fields problem