Click to See Complete Forum and Search --> : disconecting from a db


barancea
August 11th, 2001, 08:26 AM
I have a problem with closing the connection to a database after showing a data report.

Here is my code:

deX.cntX.Open
deX.cmdX parameterX
rptX.Show
deX.rscmdX.Close
deX.cntX.Close

At the beginning of the code there is no connection to database(the file Database.ldb does not exist).
I open a connection, cntX, from a data environement, deX and
a command object, cmdX (with parameters, used in the report rptX).
Then I show the report and close the recordset of the command cmdX
and the connection cntX.
Now the connection to the database is still open (the file Database.ldb still exists).

What is to be done to close this connection considering that it's possible to need to overwrite the database Database.mdb?

Thanks!
Nelly
barancea@yahoo.com