|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
zip the db on exithello 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. Erez Mor wrote:
> hello all How are you opening the file? What type of DB is it? Do you do a > 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. connection.close? Chris
Show quote
Hide quote
"I Don't Like Spam" wrote: hello chris> 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 > 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. 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 Show quoteHide quote "Erez Mor" <Erez***@discussions.microsoft.com> wrote in message news:FB3AB2E1-6E78-4FA3-A592-45697EC0F01D@microsoft.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. |
|||||||||||||||||||||||