Ok,
And is this happening after you get data out of the database the first time?
If, for example, you access your data via a datareader you have to close
the datareader afterward. Also, if an error occurrs while the datareader is
open you need to make certain to use a try catch finally structure and close
the reader in the finally section in order to make certain that it closes
properly each time.
E.g.
Try
'---Open data reader and do some things with the data (while the
datareader is open the database is locked)
Catch ex As Exception
'---Handle any exceptions that may occurr
Finally
'---Close the data reader so that the database is no longer locked
End Try
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:uy**************@TK2MSFTNGP09.phx.gbl...
Thanks for replying. I have already closed the Access when I run the aspx
file. After running this aspx file, I found I cannot open the mdb file
using Access. I cannot access even I closed all IE windows... help ....
Is there something I should do in the code to avoid this problem ??
Many thanks.
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com>
¼¶¼g©ó¶l¥ó·s»D:O5**************@TK2MSFTNGP15.phx.g bl... Do you have the access database open in it's own window while trying to
run against it?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"hkappleorange" <hk***********@yahoo.com.hk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...I ued this code to connect to a mdb file
A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA
Source=C:\Inetpub\wwwroot\ASPX\Authors.mdb" )
However, I found the Access Mdb file is locked and cannot be edited by
Access even I have closed the connection using
A.Close()
The file is simply locked.
How to avoid this problem and how to fix it ??