Thread: vb6 inquiry
View Single Post

   
  #1 (permalink)  
Old 04-16-2008, 02:29 AM
Joseph Armbruster
 
Posts: n/a
Default vb6 inquiry

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;Databa se=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

Reply With Quote