vb6 inquiry
От | Joseph Armbruster |
---|---|
Тема | vb6 inquiry |
Дата | |
Msg-id | 938f42d70510121234m121a622ahe934c1ea9c22587d@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: vb6 inquiry
|
Список | 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
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 по дате отправления: