Quick ADO question. 
Author Message
 Quick ADO question.

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]

Any help appreciated.
Andy.



Sat, 07 May 2005 19:19:09 GMT  
 Quick ADO question.
I think it'll be custom1.close
that should close the db connection, not sure if it
answers your question

Will

Quote:
>-----Original Message-----
>Hi all,

>If I use the following to connect to and read from an

Access DB, how can I
Quote:
>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]

>Any help appreciated.
>Andy.

>.



Sat, 07 May 2005 20:37:09 GMT  
 Quick ADO question.
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)



Sun, 08 May 2005 04:45:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO Question Quick!!!!

2. Quick question re VB6/ADO/Access 2000

3. SQL/VB/ADO Quick Questions

4. API, WM_SETEXT, quick question, need quick answer please

5. The quick question and the long question.

6. QUICK QUESTION:vb question/buying decision

7. Quickest way to code Copying/Moving a record key with VB/SQL using ADO

8. Where can I get Quick Quick-basic

9. Quick Question - acOpenForm

10. Quick Question about writing long queries

11. Quick syntax question on - DoCmd.RunSQL

12. A few quick question (rst related)

 

 
Powered by phpBB® Forum Software