Closing an ADOX connection?

  • Thread starter Thread starter Amil
  • Start date Start date
A

Amil

I have to CREATE an Access database via C#. ado.net doesn't allow CREATING.
So, I used ADOX (ActiveX Data Objects (ADO)) from C#. Fine. In anycase,
once I am done have have an active connection to the Access database.

Does anyone know how to close this via ado.net? I've tried telling Interop
to ReleaseComObject, but that doesn't close it. It doesn't appear I can
create an OleDbConnection from an ADOX.ActiveConnection property?

Ahhhhh! Help.

Amil
 
I added a COM reference for ADODB (Microsoft ActiveX Data Objects 2.8
Library) and then did a:

ADODB._Connection adocc = (ADODB._Connection)cat.ActiveConnection;
adocc.Close();

This worked in closing the ADOX catalog (cat in the above code) connection.

Amil
 
I added a COM reference for ADODB (Microsoft ActiveX Data Objects 2.8
Library) and then did a:

ADODB._Connection adocc = (ADODB._Connection)cat.ActiveConnection;
adocc.Close();

This worked in closing the ADOX catalog (cat in the above code) connection.

Amil

Amil,

I see you've solved your problem.

I just wanted to say that you can also use DAO from C#. That's the way I do
Compact and repair ;o)


Otis Mukinfus
http://www.otismukinfus.com
 
Back
Top