G
Guest
I have a program that uses the OleDbConnection class using C++.NET. I have
all of the appropriate includes, namespaces, references, etc. and declare the
class:
class OleDBClass {
public:
gcroot<OleDbConnection*> oleConn;
OleDBClass( ) {}
};
inside my application class. It builds just fine with that. Now I want to
open a new OleDbConnection with the following in my application class
InitInstance method:
OleDBClass *oleDBCONN;
oleDBCONN->oleConn->ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<some database name>;User
Id=admin;Password=";
oleDBCONN->oleConn->Open();
When I run it I get the error "Object reference not set to an instance of an
object", on the oleDBCONN->oleConn->ConnectionString call.
Any help would be greatly appreciated.
Thanks
all of the appropriate includes, namespaces, references, etc. and declare the
class:
class OleDBClass {
public:
gcroot<OleDbConnection*> oleConn;
OleDBClass( ) {}
};
inside my application class. It builds just fine with that. Now I want to
open a new OleDbConnection with the following in my application class
InitInstance method:
OleDBClass *oleDBCONN;
oleDBCONN->oleConn->ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<some database name>;User
Id=admin;Password=";
oleDBCONN->oleConn->Open();
When I run it I get the error "Object reference not set to an instance of an
object", on the oleDBCONN->oleConn->ConnectionString call.
Any help would be greatly appreciated.
Thanks