Groups | Blog | Home
all groups > vb.net data > january 2005 >

vb.net data : Database Maintenance from VB.Net App


Clay Ramsey
1/13/2005 9:13:02 AM
Hi all -

I am developing a MDI windows app that uses MSDE as it's data-store. I am
coding some simple maintenance procedures (pickable as a menu item from the
parent form), such as backup database, delete old records, and restore
database. Backup and deletion (coupled with a dbcc shrinkdatabase) command
work great. The problem I am having is the restore timing out because it
can't get exclusive to the database. Sometimes it works, sometimes it times
out, and I suspect this is due to some connection pooling that may still have
an active spid on my target, even though all child forms (which do db calls
via std. data adapter and stored procedures) are still out there. I switch
databases to "master" and invoke RESTORE DATABASE myDB FROM DISK='return
value from open file dialog'. How can I ensure all spids on the target are
killed prior to my issuing this command? (Note, you cannot kill your "own"
process). The db connection string uses windows security for
authentication...should I create a couple of user-id's (one for application
use, one to use for db maintenance) and try it that way?

Thanks,

Clay Ramsey
Clay Ramsey
1/14/2005 5:13:02 AM
Sorry for any confusion, but the sentence below should read that there are
still active spid's on the target database even though all child forms are
closed.

[quoted text, click to view]
AddThis Social Bookmark Button