-
I have an ADO DataControl which i at runtime connect to a database by using the ConnectionString and RecordSource properties. But what i now need to do is disconnect the control from the database so that i can delete the database. I know how to do this using the ADO objects but have not been able to do the same thing with the datacontrol. Is it possible ?
Thanks
-
This works fine for me
Code:
Dim strDBName As String
strDBName = "F:\Nwind2k.mdb"
'open db
With Me.Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBName
.RecordSource = "Select * from Customers"
.Refresh
.Recordset.Requery
'we have a value
MsgBox .Recordset(0)
'close
.Recordset.Close
Set .Recordset = Nothing
.ConnectionString = ""
.RecordSource = ""
'kill db
Kill strDBName
End With
-
Thanks, I'll give it a try