How to close ADO Data Control connection?

Within an Excel VBA application, I'm using the ADO Data Control to populate a DataGrid with data from an Access table.

I set the connection and recordsource properties on opening the file, then set them to empty strings on closing. However once my app. is closed there still exists an Access record-locking icon for the database in Explorer.

I don't seem to be able to close the database; the ADO Data Control doesn't have a connection.close method. How do I do it?  It's even causing a fatal error on Windows shutdown.
TimHudspithAsked:
Who is Participating?
 
leonstrykerConnect With a Mentor Commented:
Once you create a recordset:

Set DataGrid1.DataSource = rst

Leon
0
 
leonstrykerCommented:
Do not use the ADODC to start with. Ther eis no reason for you to do so.  Instead use ADO directyl

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

and so on. Once you create the recordset you bind it to the DataGrid.  At the end:

rs.Close
Set rs = Nothing

conn.Close
Set conn = Nothing

Leon
0
 
TimHudspithAuthor Commented:
How do I bind the DataGrid to the recordset?
0
 
TimHudspithAuthor Commented:
Thanks.
0
All Courses

From novice to tech pro — start learning today.