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

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
 
G

George

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
 
L

lucy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top