closing ADO data controls and data environment connections 
Author Message
 closing ADO data controls and data environment connections

I need to close two ADO data control connections and a data environment
connection so as to be able to back up the database they refer to.

My code for this is:

frmMain.datPrimaryRS.Recordset.Close
Set frmMain.datPrimaryRS.Recordset = Nothing

frmMain1.datPrimaryRS.Recordset.Close
Set frmMain1.datPrimaryRS.Recordset = Nothing

DataEnvironment1.Connection1.Close
Set DataEnvironment1 = Nothing

This does the job, but the lines

Set frmMain.datPrimaryRS.Recordset = Nothing and
Set frmMain1.datPrimaryRS.Recordset = Nothing

produce several OBDC error messages like: "Data source name not found and no
default driver specified."

But without a line like Set frmMain.datPrimaryRS.Recordset = Nothing I get a
permission denied on trying to save the database.

The line Set DataEnvironment1 = Nothing produces no error message.

What do I need to do to remove enough references to the two data controls
(which reference the same database) to be able to back up the database?



Mon, 04 Feb 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ado data control vs. data environment

2. Problems with ADO data control and data environment

3. Data Environment or ADO Data Control?

4. Data Environment or ADO Data Control?

5. How to close a ADO Data Control Connection?

6. How To: CLOSE an ADO Data Control CONNECTION???

7. Can't Close ADO Data Control connection

8. data environment connection will not "close"

9. use ado control, ado object or data environment?

10. Is ADO better than Data Environment connection

11. VB Data Environments & ADO Connections

12. Connection: changing connection string in data environment

 

 
Powered by phpBB® Forum Software