Kill Statement

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

AccessXP in Access2000 mode

I have the following code outline in a standard module in MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the zipfile,
MyZipfile.zip.

Thanks!

Steve
 
That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.
 
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

Michael (michka) Kaplan said:
That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Steve said:
AccessXP in Access2000 mode

I have the following code outline in a standard module in MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the zipfile,
MyZipfile.zip.

Thanks!

Steve
 
NO idea if this will make a difference, but try giving the mdb and zip files
different names, e.g., temp.mdb and MyOtherDatabase.mdb. Does that change
anything?
 
Windoze works asychronously, so you start the process which makes a zip
file, but before zip geta around to actually creating and saving the zip
file, your next process comes in and deletes the .mdb which zip is supposed
to be working on....

You have to use a Wait for Process to end API call to ensure that the zip is
finished before doing the Kill.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Steve said:
AccessXP in Access2000 mode

I have the following code outline in a standard module in MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the zipfile,
MyZipfile.zip.

Thanks!

Steve
 
The kill is Killing before the Create Zip has finished.

(david)

Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


Steve said:
AccessXP in Access2000 mode

I have the following code outline in a standard module in MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the zipfile,
MyZipfile.zip.

Thanks!

Steve
 
Bruce,

Thanks for responding!

Take a close look at my post, I already do this. The database file is named
MyOtherDatabase.mdb and when I zip it, I name the zip file, MyZipfile.zip. Then
in the Kill statement I explicitly name MyOtherDatabase.mdb to Kill.

Steve
 
Hi,
Not sure how you're perfoming the zip, but if it's using Shell
and the zip command line tool, unless your using the ShellAndWait
code, that kill statement will execute immediately and presto no
more file to zip.
 
David,

Thanks for responding!

That makes sense! Do you have any suggestions of what to add to the code to
overcome that problem?

Steve


david epsom dot com dot au said:
The kill is Killing before the Create Zip has finished.

(david)

Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


AccessXP in Access2000 mode

I have the following code outline in a standard module in
MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the
zipfile,
MyZipfile.zip.

Thanks!

Steve
 
Yes, I'm using Shell and the zip command line tool. I found the Shell and Wait
code at mvps.org/access website and will try that.

Thanks for the help, Dan!!
 
Adrian Jansen said:
Windoze works asychronously, so you start the process which makes a zip
file, but before zip geta around to actually creating and saving the zip
file, your next process comes in and deletes the .mdb which zip is supposed
to be working on....

You have to use a Wait for Process to end API call to ensure that the zip is
finished before doing the Kill.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


AccessXP in Access2000 mode

I have the following code outline in a standard module in
MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the
zipfile,
MyZipfile.zip.

Thanks!

Steve
 
Thanks for responding, Adrian!!

You're confirming what another poster said.

Steve


Adrian Jansen said:
Windoze works asychronously, so you start the process which makes a zip
file, but before zip geta around to actually creating and saving the zip
file, your next process comes in and deletes the .mdb which zip is supposed
to be working on....

You have to use a Wait for Process to end API call to ensure that the zip is
finished before doing the Kill.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


AccessXP in Access2000 mode

I have the following code outline in a standard module in
MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the
zipfile,
MyZipfile.zip.

Thanks!

Steve
 
You will have to look at the code for creating the zip:
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip

(david)

Steve said:
David,

Thanks for responding!

That makes sense! Do you have any suggestions of what to add to the code to
overcome that problem?

Steve


david epsom dot com dot au said:
The kill is Killing before the Create Zip has finished.

(david)

Steve said:
Michka,

Thanks for responding!

When I comment out the Kill statement, MyOtherDatabase.mdb and MyZipfile.zip are
both there. If I run the code as shown in my post (with the Kill statement)
neither of these files are there.

Steve

That is not possible.

Most likely the zip failed, thus the file was never created in the first
place.


--
MichKa [MS]

This posting is provided "AS IS" with
no warranties, and confers no rights.


AccessXP in Access2000 mode

I have the following code outline in a standard module in
MyDatabase.mdb ---

Use CreateDatabase to create MyOtherDatabase.mdb
Use two make table queries to create two tables in MyOtherDatabase.mdb
Programatically zip MyOtherDatabase.mdb as MyZipfile.zip
Kill "MyOtherDatabase.mdb" 'this is the actual line of code

Does anyone have any ideas on why the Kill statement also deletes the
zipfile,
MyZipfile.zip.

Thanks!

Steve
 
Back
Top