Releasing DataBase after Creating

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

Guest

I create a database file using ADOX Catalog. However, I want to later delete
the file but I get an error message that the database is being used by
another process. I have even tried creating the database then deleting it
immediately after with no other manipulations of creating tables, etc. It
seems that the ADOX catalog create method does not release the file. I've
even tried setting it to nothing but still it holds it in it's process. How
do I release the file?

Dim catNewDB As New ADOX.Catalog
Dim fi As New IO.FileInfo(DBName)
Try
If fi.Exists Then
fi.Delete()
End If
catNewDB.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBName)
catNewDB = Nothing
catch
end try
dim fi as new IO.FileInfo(DBName)
fi.Delete 'get error here saying that another process using the file.
 
Dennis,

Although I use almost the same code as you and have sometimes the same
problem while debugging (actually yesterday), do I use this code only
because there is in ADONET no way to create a file.

I have this problem mostly when I kill a debugging process

However when you are curious about a solution, than would be a good
newsgroup in my opinion. (Beside that maybe in this newsgroup somebode knows
the solution of course for what, although I not directly need it, am as well
curious for)

Microsoft.public.data.ado

(It is a newsgroup with medium/low activity however most questions get an
answer there)

I hope this helps,

Cor
 

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

Back
Top