Re: C++oo4ole/ Oraclm32.dll access violation

From: Anthony Fedirko <afedirko_at_yahoo.com>
Date: 19 Oct 2001 05:56:52 -0700
Message-ID: <1c1cbf24.0110190456.65a75b26_at_posting.google.com>


I figured out the problem.

I added 2 lines:

odyn.Close();
odb.Close();

before the call to OShutdown();

afedirko_at_yahoo.com (Anthony Fedirko) wrote in message news:<1c1cbf24.0110180812.1b729ec7_at_posting.google.com>...
> Hello,
>
> I am attempting to run the Oracle OO4O sample with a slight
> modification and I get an Access Violation on the OShutdown() call:
>
> First-chance exception in Tony3.exe (ORACLM32.DLL): 0xC0000005: Access
> Violation.
>
> I tried uninstalling OO4O and installing the latest files for the OTN
> site OO4O version 8.1.6.3.1.3 and it did not help.
>
> Thanks,
> Tony
>
> Below is the code:
>
> #include<stdio.h>
> #include<stdlib.h>
> #include "oracl.h"
>
> int main()
> {
> // Initialize the C++ Class Library before use.
> // Usually initialization is done at the beginning of the program.
> OStartup();
>
> // Construct a database, obtaining a database connection:
> ODatabase odb("RD2T", "scott", "tiger");
> // The Odatabase object (odb) allows you to connect to a database
> // ("ExampleDB") along with other connection information, and so sets
> // you up to execute SQL statements.
>
> // Construct a dynaset, obtaining the data records:
> ODynaset odyn(odb, "select * from emp");
>
> // The dynaset (odyn) corresponds to a cursor. It gives you access
> // to the rows that are obtained by an SQL select statement.
>
> // Create a variable to contain salary information:
> double salary;
>
> // Now look at each record:
> while (!odyn.IsEOF())
> // This method (IsEOF) returns TRUE when you have moved through the
> // entire set.
> {
> // Get the salary for the current record:
> odyn.GetFieldValue("sal", &salary);
>
> printf("Salary = %f\n", salary);
>
> // This overloaded method (GetFieldValue) obtains the value of
>
> // a field in the current record of the dynaset.
>
> // Do something with the salary:
> //salary = salary + 1;
>
> // This method (Analyze) is created by the user.
>
> // Go to the next record (perhaps moving past the last record):
> odyn.MoveNext();
> // This overloaded method (MoveNext) changes the current record
> // to be the next record in the dynaset's result set.
> }
> // Uninitialize the C++ Class Library when you are finished with it.
> // Usually uninitialization is done at the end of the program.
>
> OShutdown();
>
> return 0;
>
> }
Received on Fri Oct 19 2001 - 14:56:52 CEST

Original text of this message