| View previous topic :: View next topic |
| Author |
Message |
pduncan
Joined: 21 Jul 2006 Posts: 4
|
Posted: Wed Nov 08, 2006 11:25 pm Post subject: Access database remains open |
|
|
I am making an ADO connection to access. When I am done, I close and destroy my connections (I think?) but the Access database remains open. The only way I can get rid of the .ldb file is to stop the web server.
I end the code on my page with
| Code: |
oRS.Close
set oRS = Nothing
oConn.Close
set oConn = Nothing
|
Can you please suggest what I am doing wrong |
|
| Back to top |
|
 |
pduncan
Joined: 21 Jul 2006 Posts: 4
|
Posted: Thu Nov 09, 2006 7:07 am Post subject: |
|
|
I found the solution...
remove "server."
Server.CreateObject("ADODB.Connection")
and
Server.CreateObject("ADODB.Recordset") |
|
| Back to top |
|
 |
admin Site Admin
Joined: 13 Apr 2005 Posts: 1467
|
Posted: Thu Nov 09, 2006 7:25 am Post subject: |
|
|
Using
Server.CreateObject("")
will cache the database connection and adds a reference to the server's internal dispatch list.
Always use
CreateObject("ADODB.Connection")
unless you have a good reason to use Server.CreateObject("")
(for example event processing of ASP plugins) |
|
| Back to top |
|
 |
|