[OCI & VBA] oradyn_nocache sets rowposition to last
Date: 14 Jan 2003 06:22:45 -0800
Message-ID: <eb94b52d.0301140622.429cd37_at_posting.google.com>
Guten Tag,
I am programming in VBA with OCI. If I create a dynaset with the ORADYN_NOCACHE flag, the property RowPosition allways points to the last row of the dynaset. It's therefore impossible to read forward (as described in the help file).
Here is what I am trying to do:
Dim OraSession As OraSession, _
OraDatabase As OraDatabase, _
OraDynaset As OraDynaset, _
sqlStatement as String
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.OpenDatabase(ALIAS, DBUSER & "/" &
DBPASSWORT, ORADB_DEFAULT)
sqlStatement = "select * from mytable"
Set OraDynaset = OraDatabase.CreateDynaset(sqlStatement,
ORADYN_NOCACHE)
Do Until OraDynaset.EOF
[do something]
OraDynaset.MoveNext
Loop
The variables in uppercase are declared as public constants. ORADYN_NOCACHE has the correct value of &H8&. At creation of the dynaset (...CreateDynaset(sqlStatement, ORADYN_NOCACHE)) the rowposition is allready on the last row. The OraDynaset.MoveNext inside the loop tries to read beyond EOF.
The online help to ORADYN_CACHE reads: "... Use this option in
applications that make single passes through the rows of a dynaset for
increased performance ..."
But how do I pass through the rows? A Dynaset.MoveFirst won't work.
Please do reply directly to the newsgroup and do not use x-archive-no (or similar). I am using google and therefore couldn't read your answers.
Danke in advance
Erwin Schlonz
Received on Tue Jan 14 2003 - 15:22:45 CET