ADOX initialisation problem
Anyone have an idea why the following code doesn't work
It seems that the ADOXCatalog object is not initialised because I receive the following:
<<<<<<<<>>>>>>>>>>
when trying to use the ADOXCatalog pointer on the last line of code !!!!
//**************************************************************
using System.Runtime.InteropServices;
using ADODB;
using ADOX;
ADODB.Connection m_obj_ADODBConnection;
ADOX.Catalog m_obj_ADOXCatalog;
m_obj_ADODBConnection = new ADODB.Connection();
m_obj_ADODBConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/toto.mdb", "Admin", null, 0);
m_obj_ADOXCatalog = new ADOX.Catalog();
m_obj_ADOXCatalog.ActiveConnection = m_obj_ADODBConnection;
ADOX.Table obj_ADOXTable;
obj_ADOXTable = m_obj_ADOXCatalog.Tables["SomeTableName"];
// -> Object Reference not set to an instance of an object
// **************************************************************
Any help is welcomed...
Sylvain.
Answers
Know the answer? Post it. Somebody with the same question will find it here.