DB exclusively used by another user.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a newbie of ASP.Net. In my first appliction. I connect a webform using an OleDbConnection object.
I also put a Datagrid on the web form and populate the datagrid with datareader. However, I couldn't get through.
I got the error of :
"The Microsoft Jet database engine cannot open the file ' ...path..rp.mdb'. It is already opened exclusively by another user, or you need permission to view its data."

I also follow the bug dix resolution to reconfigure IIS directory security. It still didn't work. Can someone tell me how to correct this ?
 
Tracy said:
I am a newbie of ASP.Net. In my first appliction. I connect a webform
using an OleDbConnection object.
I also put a Datagrid on the web form and populate the datagrid with
datareader. However, I couldn't get through.
I got the error of :
"The Microsoft Jet database engine cannot open the file '
...path..rp.mdb'. It is already opened exclusively by another user,
or you need permission to view its data."

I also follow the bug dix resolution to reconfigure IIS directory
security. It still didn't work. Can someone tell me how to correct
this ?

Either you have the database open in Access while running the page
(I guess you're using Access), or the database was left open in an
earlier try (your code caused an error, the program stopped, and
the code for closing the connection was never executed).

In the latter case, you'll probably have to restart IIS to free the
database,
if this doesn't help, restart Windows.

To prevent this problem, use an exception block (this is for VB):

***********************
Try
conn.Open()
... all datareader stuff here ...
Finally
conn.Close()
End Try
************************

With this code, when something goes wrong, you make sure that the
connection is closed.
 
Back
Top