473,385 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Moving/deleting the DB upon close

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
1 959
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Diogo Alves - Software Developer | last post by:
Greetings I would like to knowhow can I put a sliding panel... I've done this: if (panel1.Width < 300) { while (panel1.Width < 300) { panel1.Width = panel1.Width + 40;
24
by: Frank Swarbrick | last post by:
We have a batch process that inserts large numbers (100,000 - 1,000,000) of records into a database each day. (DL/I database.) We're considering converting it to a DB2 table. Currently we have...
1
by: sphinney | last post by:
All, I'm not sure how to adequately explain my problem in two sentences or less, so at the risk of providing TMI, here's the condensed verion. I have developed an Access 2002 database file that...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.