MS-Access LDB File Still Exists

MS-Access LDB File Still Exists

am 14.12.2005 17:18:13 von McKirahan

I have an ASP page that uses an MS-Access database.

When I run it on my Web host's server the databases's
".LDB" file still exists after completion.

I gather this happens when a connection is left open.

I believe I am closing all my connections by using
"Set objXXX = Nothing".

Below is all of the code that works with the database.

Can anyone spot a problem? Thanks in advance.

Sub Process1()
Dim objADO
Set objADO = Server.CreateObject("ADODB.Connection")
objADO.Open cDSN & Server.MapPath("Database1.mdb")
Dim objRST
'*
Set objRST = Server.CreateObject("ADODB.Recordset")
objRST.Open "Table1", objADO, adOpenKeySet, adLockOptimistic,
adCmdTable
objRST.AddNew
objRST("Field1").Value = ""
objRST.Update
objRST.Close
Set objRST = Nothing
'*
objADO.Close
Set objADO = Nothing
End Sub

Sub Process2()
Dim objADO
Set objADO = Server.CreateObject("ADODB.Connection")
objADO.Open cDSN & Server.MapPath("Database1.mdb")
Dim objRST
Dim objRSU
Dim objRSX
'*
Set objRSX = objADO.Execute("DELETE FROM Table2")
Set objRSX = Nothing
'*
Set objRSX = Server.CreateObject("ADODB.Recordset")
objRSX.Open "Table2", objADO, adOpenKeySet, adLockOptimistic,
adCmdTable
objRSX.AddNew
objRSX("Field1").Value = objRST("Field1").Value
objRSX.Update
objRSX.Close
Set objRSX = Nothing
'*
Set objRST = objADO.Execute(strSQL)
Do While Not objRST.EOF
objRST.MoveNext
Set objRST = Nothing
'*
Set objRST = objADO.Execute(strSQL)
Do While Not objRST.EOF
Set objRSU = objADO.Execute(strSQL)
Set objRSU = Nothing
objRST.MoveNext
Set objRST = Nothing
'*
Set objRST = objADO.Execute(strSQL)
Do While Not objRST.EOF
objRST.MoveNext
Set objRST = Nothing
'*
Set objRST = objADO.Execute(strSQL)
Do While Not objRST.EOF
objRST.MoveNext
Set objRST = Nothing
'*
objADO.Close
Set objADO = Nothing
End Sub



A Google Groups search found that I posted
a similar question almost three years ago:

URL:http://groups.google.com/group/microsoft.public.inetserv er.asp.db/browse
_thread/thread/1a32044a73633701/6f6459aaefc85576?q=MS-Access +LDB+group%3Amic
rosoft.public.inetserver.asp.*&rnum=1#6f6459aaefc85576

The single response there does not apply.

Re: MS-Access LDB File Still Exists

am 14.12.2005 19:20:52 von reb01501

McKirahan wrote:
> I have an ASP page that uses an MS-Access database.
>
> When I run it on my Web host's server the databases's
> ".LDB" file still exists after completion.

This is usually a permissions problem. All database users must have Modify
rights for the folder that contains the database. is your site using forms
or integrated authentication? Is Anonymous turned on?
>
> I gather this happens when a connection is left open.
>

That's one way for this to happen. Another is a failure to delete the file
due to lack of permissions.

> I believe I am closing all my connections by using
> "Set objXXX = Nothing".

Actually, a connection is closed via the Close method. But dereferencing the
object should cause the connection to close before it is destroyed.

Of course, with session pooling, connections will remain open for a set
period of time.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: MS-Access LDB File Still Exists

am 14.12.2005 20:23:13 von Kyle Peterson

probably not code related

most likely permissions... the server can not properly create and delete the
lock file
http://www.powerasp.com/content/new/windows_2003_server_and_ permissions.asp

also, the database folder needs permissions...not just the .mdb file and
that can also be an issue if the whole folder wasn't given permissions


"McKirahan" wrote in message
news:zd2dncyJSOAQ2D3eRVn-ow@comcast.com...
>I have an ASP page that uses an MS-Access database.
>
> When I run it on my Web host's server the databases's
> ".LDB" file still exists after completion.
>
> I gather this happens when a connection is left open.
>
> I believe I am closing all my connections by using
> "Set objXXX = Nothing".
>
> Below is all of the code that works with the database.
>
> Can anyone spot a problem? Thanks in advance.
>
> Sub Process1()
> Dim objADO
> Set objADO = Server.CreateObject("ADODB.Connection")
> objADO.Open cDSN & Server.MapPath("Database1.mdb")
> Dim objRST
> '*
> Set objRST = Server.CreateObject("ADODB.Recordset")
> objRST.Open "Table1", objADO, adOpenKeySet, adLockOptimistic,
> adCmdTable
> objRST.AddNew
> objRST("Field1").Value = ""
> objRST.Update
> objRST.Close
> Set objRST = Nothing
> '*
> objADO.Close
> Set objADO = Nothing
> End Sub
>
> Sub Process2()
> Dim objADO
> Set objADO = Server.CreateObject("ADODB.Connection")
> objADO.Open cDSN & Server.MapPath("Database1.mdb")
> Dim objRST
> Dim objRSU
> Dim objRSX
> '*
> Set objRSX = objADO.Execute("DELETE FROM Table2")
> Set objRSX = Nothing
> '*
> Set objRSX = Server.CreateObject("ADODB.Recordset")
> objRSX.Open "Table2", objADO, adOpenKeySet, adLockOptimistic,
> adCmdTable
> objRSX.AddNew
> objRSX("Field1").Value = objRST("Field1").Value
> objRSX.Update
> objRSX.Close
> Set objRSX = Nothing
> '*
> Set objRST = objADO.Execute(strSQL)
> Do While Not objRST.EOF
> objRST.MoveNext
> Set objRST = Nothing
> '*
> Set objRST = objADO.Execute(strSQL)
> Do While Not objRST.EOF
> Set objRSU = objADO.Execute(strSQL)
> Set objRSU = Nothing
> objRST.MoveNext
> Set objRST = Nothing
> '*
> Set objRST = objADO.Execute(strSQL)
> Do While Not objRST.EOF
> objRST.MoveNext
> Set objRST = Nothing
> '*
> Set objRST = objADO.Execute(strSQL)
> Do While Not objRST.EOF
> objRST.MoveNext
> Set objRST = Nothing
> '*
> objADO.Close
> Set objADO = Nothing
> End Sub
>
>
>
> A Google Groups search found that I posted
> a similar question almost three years ago:
>
> URL:http://groups.google.com/group/microsoft.public.inetserv er.asp.db/browse
> _thread/thread/1a32044a73633701/6f6459aaefc85576?q=MS-Access +LDB+group%3Amic
> rosoft.public.inetserver.asp.*&rnum=1#6f6459aaefc85576
>
> The single response there does not apply.
>
>

Re: MS-Access LDB File Still Exists

am 28.01.2006 13:44:28 von reb01501

McKirahan wrote:
> I have an ASP page that uses an MS-Access database.
>
> When I run it on my Web host's server the databases's
> ".LDB" file still exists after completion.
>

Is this resolved?

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: MS-Access LDB File Still Exists

am 28.01.2006 16:39:16 von McKirahan

"Bob Barrows [MVP]" wrote in message
news:uSepQiAJGHA.1028@TK2MSFTNGP11.phx.gbl...
> McKirahan wrote:
> > I have an ASP page that uses an MS-Access database.
> >
> > When I run it on my Web host's server the databases's
> > ".LDB" file still exists after completion.
> >
>
> Is this resolved?

Bob, thanks for the follow up.

I used my Web host's Admin Console to:

Change Permissions

OK: Set the permissions of browser to
READ/WRITE/EXECUTE/DELETE
on d:\0.0.0.0\folder successfully.

(Path changed to protect the innocent.)

Unfortunately, their console did not allow me to
see what the setting was before I changed it.

I think that did it. Thanks again!