Re: [OCI & VBA] oradyn_nocache sets rowposition to last
From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Tue, 14 Jan 2003 14:27:44 GMT
Message-ID: <A7VU9.48416$Dn.9224_at_sccrnsc03>
Date: Tue, 14 Jan 2003 14:27:44 GMT
Message-ID: <A7VU9.48416$Dn.9224_at_sccrnsc03>
try changing it like this:
> Do while OraDynaset.MoveNext
> [do something]
> Loop
I believe that it should work. I have used this parameter and it worked for
me. It might be positioned "before" the first row and appear that it is at
the last row (you would have to test bof, eof to know)
Jim
-- Replace part of the email address: kennedy-down_with_spammers_at_attbi.com with family. Remove the negative part, keep the minus sign. You can figure it out. "Erwin Schlonz" <schlonz.2.erwin_at_spamgourmet.com> wrote in message news:eb94b52d.0301140622.429cd37_at_posting.google.com...Received on Tue Jan 14 2003 - 15:27:44 CET
> 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