Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

ADOX initialisation problem

Apr 10 2003 4:48 PM
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.