473,326 Members | 2,124 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,326 software developers and data experts.

zip the db on exit

hello all
i'm using vb2005
i want my application to unzip the db file uppon startup (which i managed to
do quite right) and place in the right folder, then, when program ends, to
zip it and keep it in a different folder.
as i said, the login form does the job quite well for the unzip proccess,
but when i try to zip it at the end the file "is in use" and cannot be
copied. how can i release it from the application? while it is still running?
thankx
Erez.
Mar 21 '06 #1
3 977
Erez Mor wrote:
hello all
i'm using vb2005
i want my application to unzip the db file uppon startup (which i managed to
do quite right) and place in the right folder, then, when program ends, to
zip it and keep it in a different folder.
as i said, the login form does the job quite well for the unzip proccess,
but when i try to zip it at the end the file "is in use" and cannot be
copied. how can i release it from the application? while it is still running?
thankx
Erez.


How are you opening the file? What type of DB is it? Do you do a
connection.close?

Chris
Mar 21 '06 #2


"I Don't Like Spam" wrote:
Erez Mor wrote:
hello all
i'm using vb2005
i want my application to unzip the db file uppon startup (which i managed to
do quite right) and place in the right folder, then, when program ends, to
zip it and keep it in a different folder.
as i said, the login form does the job quite well for the unzip proccess,
but when i try to zip it at the end the file "is in use" and cannot be
copied. how can i release it from the application? while it is still running?
thankx
Erez.


How are you opening the file? What type of DB is it? Do you do a
connection.close?

Chris


hello chris
the db file is a sqlexpress mdf file (the zip file holds both the mdf and
ldf files)
i dont explicitly open the connection, it's opened the first time i access
the dataset (i created with the add new data source wizard)
i was looking for the right connection.close code but i cant find where is
this connection that i'm supposed to close
Erez.
Mar 21 '06 #3
AFAIK if SQL Server 2005 works in the same which in which MSSQL 2000 works
the MDF file is "attached" to the Server and even when your application ends
SQL Server still has the MDF file in use.

Again, not sure if 2005 is the same but you might want to look up the BACKUP
DATABASE T-sql commands or if you really do want to take it completely
offline (don't know why you would) you might want to look into the system
stored procedure sp_detach_db

Hope this information is of help to you.

Regards

Ian
"Erez Mor" <Er*****@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...


"I Don't Like Spam" wrote:
Erez Mor wrote:
> hello all
> i'm using vb2005
> i want my application to unzip the db file uppon startup (which i
> managed to
> do quite right) and place in the right folder, then, when program ends,
> to
> zip it and keep it in a different folder.
> as i said, the login form does the job quite well for the unzip
> proccess,
> but when i try to zip it at the end the file "is in use" and cannot be
> copied. how can i release it from the application? while it is still
> running?
> thankx
> Erez.


How are you opening the file? What type of DB is it? Do you do a
connection.close?

Chris


hello chris
the db file is a sqlexpress mdf file (the zip file holds both the mdf and
ldf files)
i dont explicitly open the connection, it's opened the first time i access
the dataset (i created with the add new data source wizard)
i was looking for the right connection.close code but i cant find where is
this connection that i'm supposed to close
Erez.

Mar 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Ivan Voras | last post by:
In a code such as: if len(sys.argv) < 2: print "I need arguments!" sys.exit(1) Is sys.exit() really a good choice? Is there something more elegant? (I tried return but it is valid only in a...
1
by: Guinness Mann | last post by:
Pardon me if this is not the optimum newsgroup for this post, but it's the only .NET newsgroup I read and I'm certain someone here can help me. I have a C# program that checks for an error...
1
by: Brendan Miller | last post by:
I am trying to close my application using Application.exit() in the frmMain_Closing event. When the form closes the process does not. My application only has one form (no other classes either). ...
4
by: Bob Day | last post by:
Using VS 2003, VB.net... I am confused about the Application.Exit method, where the help states "This method does not force the application to exit." Aside from the naming confusion, how do I...
1
by: =?Utf-8?B?VGFvZ2U=?= | last post by:
Hi All, When I use applcation.exit() in winForm application, the form closed, but the process is still going!! ( The debug process is still running if debug in VS IDE). Environment.Exit(0) works...
16
by: Laurent Deniau | last post by:
I would like to know if the use of the pointer ref in the function cleanup() below is valid or if something in the norm prevents this kind of cross-reference during exit(). I haven't seen anything...
11
by: yawnmoth | last post by:
To quote from <http://php.net/function.include>, "Because include() is a special language construct, parentheses are not needed around its argument. Take care when comparing return value." ...
11
by: =?Utf-8?B?U3RldmVEQjE=?= | last post by:
Hi all. I'm using VS 2008 Express C++. I created a console application back in 1999, and updated it for VC++ 6.0 in 2001. I've updated again this past month, and have found enough differences...
39
by: mathieu | last post by:
Hi there, I am trying to reuse a piece of code that was designed as an application. The code is covered with 'exit' calls. I would like to reuse it as a library. For that I renamed the 'main'...
0
by: Gary Robinson | last post by:
In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() But I don't see exit() mentioned as a built-in function; rather the Python Library Reference says we...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.