On Tue, 19 Nov 2002 11:19:09 +0000 (UTC), "PrintQuote Software"
Hi all,
If I use the following to connect to and read from an Access DB, how can I
disconnect from the DB to release the .ldb file.
' Used to connect
strProvider = "Microsoft.Jet.OLEDB.4.0"
strDataSource = "config.mdb"
custom1.ConnectionString = "Provider=" & strProvider & ";Data Source=" &
strDataSource & ";Persist Security Info=False" & ";Jet OLEDB"
custom1.RecordSource = "select * from config"
custom1.Refresh
' Used to read from DB
custom1.recordset.MoveFirst
text1.text = custom1.recordset![address]
Data Controls tend to maintain persistent connections - that is how they are
designed. Short of shutting down the app I'm not sure if there is anything else
you can do.
The only other alternative might be to use ADO to establish your Connection and
create your Recordset, and then assign the ADO Recordset to your ADO Data
Controls RecordSet property. This will enable you to close the connection using
the ADO Connection object.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adod...
Microsoft MVP (Visual Basic)