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

Moving/deleting the DB upon close

P: n/a
dear all
i'm using vb2005 and SSE.
using the application's startup event, i'm copying the db file (.mdf) to
it's location (a ram-drive). that seems to work fine (i only connect to it
after a successful login, so it doesnt "know" the db is not there...)
then, using the application's shutdown event, i want to copy it back to it's
permanent lodge (the hard drive). this doesnt work. whatever i try to do with
the file/folder, the file is in use (i guess by the app?) and cant be
copied/deleted/moved

what should i do to set it free? i cant find where is the connection that
needs to be closed. (cause i never explicitly opened it)

thanx in advance,
Erez.

Mar 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Erez Mor wrote:
dear all
i'm using vb2005 and SSE.
using the application's startup event, i'm copying the db file (.mdf) to
it's location (a ram-drive). that seems to work fine (i only connect to it
after a successful login, so it doesnt "know" the db is not there...)
then, using the application's shutdown event, i want to copy it back to it's
permanent lodge (the hard drive). this doesnt work. whatever i try to do with
the file/folder, the file is in use (i guess by the app?) and cant be
copied/deleted/moved

what should i do to set it free? i cant find where is the connection that
needs to be closed. (cause i never explicitly opened it)

thanx in advance,
Erez.


You did open it. It may be happening in the designer generated code
though. Look throught the code in that region and you should see your
connection. However as was posted to you before, Sql server may be
(read: probably) locking the data files. You will have to find a way to
shutdown Sql Server to free the file.

Chris
Mar 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.