2 Replies Latest reply on Feb 5, 2003 8:15 PM by 383598

    Windows XP,  Visual Basic 5 and OO4O

      We have a VB 5 application that uses OO4O ( to access an Oracle 8i database.

      We run the following code to create unique and consecutive sequence numbers:

      sqlString = "SELECT SEQ_TBLCHEQUEREQ.NextVal as CINum FROM Sys.Dual"
      Set OraDynaset = oraDatabase.DBCreateDynaset(sqlString, 0&)
      CINumber = OraDynaset.Fields("CINum").Value

      Running under an NT 4 Workstation client, there is no problem. Since we migrated to XP, the sequence numbers increment by twos. I suspect that the OraDynaSet is created twice somehow.

      The sequence is set to increment by ones with no cache and works properly in SQL*Plus.

      Any ideas as to what would cause this?

        • 1. Re: Windows XP,  Visual Basic 5 and OO4O
          I'm not sure what's causing your problem, but I did want to ensure that you're aware that there's no way to guarantee a gap-free Oracle sequence. The only way to do this is through a hideous hack where you create a table, rather than a sequence, with one row in it, though this forces all your session to serialize.

          One of many askTom links on the subject...

          • 2. Re: Windows XP,  Visual Basic 5 and OO4O
            I've run into a similar problem under Windows 2000. The solution I found is to change the "Set OraDynaset..." statement to the following:

            "Set OraDynaset = oraDatabase.DBCreateDynaset(sqlString, 20&)"

            The option '20&' at the end will cancel out the automatic refetch which is done by the Oracle Database object.