Error: The process cannot access the file ".mdb" because it is being used by another process.

  • Thread starter Thread starter lucy
  • Start date Start date
L

lucy

Hi,
I use ADOX to create a Access database programmatically from my asp.net
application
and save ".mdb" file to a temp folder under my project foler on the web

server. After database is created successfuly, I saw two files ".mdb"
and ".ldb" in my temp folder. I have no problem to open the database
manually. But when I'm tring to use Response.WriteFile() to download
database file to end user's local machine, I kept getting the following

error message - "The process cannot access the file ".mdb" because it
is being used by another process."


Any help is highly appreciated.

thanks
 
Well, If you see ldb file that means connection to DB is open.

Did you explicity closed the connection? Or that ADOX object.
Probably not

George.

Hi,
I use ADOX to create a Access database programmatically from my asp.net
application
and save ".mdb" file to a temp folder under my project foler on the web

server. After database is created successfuly, I saw two files ".mdb"
and ".ldb" in my temp folder. I have no problem to open the database
manually. But when I'm tring to use Response.WriteFile() to download
database file to end user's local machine, I kept getting the following

error message - "The process cannot access the file ".mdb" because it
is being used by another process."


Any help is highly appreciated.

thanks
 
Thank you very much for your response. I use try...catch..finally in my
source code. And in finally block I set cat.ActiveConnection = Nothing

cat = Nothing
where cat is adox object.

What else am I missing?

thanks
 
Back
Top