Hello,
My Sybase driver setting is set to "Select Method: Direct". This
option means only one active cursor is available at anytime.
As a result, my C++ program crashes when I try to open 2 recordsets.
However, my VB probram using ODBC direct does not - everything just
works fine. Why so? I thought it could be due to the CacheSize, but
even on very big table, VB does not crash.
Here is my code:
<------------------------------------>
Set ws = DBEngine.CreateWorkspace("ODBCDirectConnection", "admin",
"", dbUseODBC)
ws.DefaultCursorDriver = dbUseNoCursor
Let strConnection = "ODBC;DSN=" & GODBC & ";UID=" & GLogin &
";PWD=" & GPassword
Set newdb = ws.OpenConnection("VBGatewayConnection",
dbDriverNoPrompt, False, strConnection)
Set req1 = newdb.OpenRecordSet("SELECT * FROM om_trades",
dbOpenForwardOnly)
Dim R As Long
R = req1.CacheSize
While (Not (req1.EOF))
Set req2 = newdb.OpenRecordSet("SELECT * FROM om_trades",
dbOpenForwardOnly)
While (Not (req2.EOF))
req2.MoveNext
Wend
req1.MoveNext
Wend
req1.Close
<------------------------------------>
I would like to understand why, because this might mean VB is behaving
in an inefficient way for us.
Thanks a lot for your attention and suggestion,
SerGioGio
>> Stay informed about: ODBCDirect and VB