By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,932 Members | 1,486 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,932 IT Pros & Developers. It's quick & easy.

Releasing DataBase after Creating

P: n/a
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 in Houston
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.