473,378 Members | 1,478 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,378 software developers and data experts.

Batch File Problem

I want to run the following batch file from Scheduler each night from a
command line:
'm:\dpc data\createbackup.bat'

The batch file is simply:
ECHO Off
Start createbackup.mdb

where 'createbackup.mdb' (which resides in 'm:\dpc data') compacts and
repairs the file into a temp folder and returns it to its original location.

It does exactly what I expect, except that the following Windows error is
generated immediately after the second line of the batch file is executed -
ie after the mdb is successfully finished:
'Windows cannot find 'M:\dpc data\createbackup.mdb' etc etc
If I insert MsgBox "Done", immeditaely before DoCmd Quit in my mdb, then
this message box appears and when acknowledged the program completes without
the above error.
I need the batch to run without user intervention at 1am each morning, so
the error msg is causing a problem.
Any help appreciated.

Bob

Nov 12 '05 #1
5 5334
Bob,
Is it so that your mdb is trying to copy the new file to it's original locaton while it's not ready
compacting yet?
If so, try to 'dir' until it's there?

Without more info on your code it's difficult to guess what's causing your problem.

--
Hope this helps
Arno R

"Bob Darlington" <bo*@dpcmanAX.com.au> schreef in bericht
news:3f***********************@news.optusnet.com.a u...
I want to run the following batch file from Scheduler each night from a
command line:
'm:\dpc data\createbackup.bat'

The batch file is simply:
ECHO Off
Start createbackup.mdb

where 'createbackup.mdb' (which resides in 'm:\dpc data') compacts and
repairs the file into a temp folder and returns it to its original location.

It does exactly what I expect, except that the following Windows error is
generated immediately after the second line of the batch file is executed -
ie after the mdb is successfully finished:
'Windows cannot find 'M:\dpc data\createbackup.mdb' etc etc
If I insert MsgBox "Done", immeditaely before DoCmd Quit in my mdb, then
this message box appears and when acknowledged the program completes without
the above error.
I need the batch to run without user intervention at 1am each morning, so
the error msg is causing a problem.
Any help appreciated.

Bob

Nov 12 '05 #2
Thanks Arno,
No, the error occurs after the program has done everything. ie just before
DoCmd.Quit.

--
Bob Darlington
Brisbane
"Arno R" <ar****************@tiscali.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Bob,
Is it so that your mdb is trying to copy the new file to it's original locaton while it's not ready compacting yet?
If so, try to 'dir' until it's there?

Without more info on your code it's difficult to guess what's causing your problem.
--
Hope this helps
Arno R

"Bob Darlington" <bo*@dpcmanAX.com.au> schreef in bericht
news:3f***********************@news.optusnet.com.a u...
I want to run the following batch file from Scheduler each night from a
command line:
'm:\dpc data\createbackup.bat'

The batch file is simply:
ECHO Off
Start createbackup.mdb

where 'createbackup.mdb' (which resides in 'm:\dpc data') compacts and
repairs the file into a temp folder and returns it to its original location.
It does exactly what I expect, except that the following Windows error is generated immediately after the second line of the batch file is executed - ie after the mdb is successfully finished:
'Windows cannot find 'M:\dpc data\createbackup.mdb' etc etc
If I insert MsgBox "Done", immeditaely before DoCmd Quit in my mdb, then this message box appears and when acknowledged the program completes without the above error.
I need the batch to run without user intervention at 1am each morning, so the error msg is causing a problem.
Any help appreciated.

Bob


Nov 12 '05 #3
Bob,
If I understood you well then you said when you insert a msgbox "Done"
before docmd.Quit you have no problem?
Hence it still seems to me that Access is not finished with 'something'.
Again: Without more info on your code it's difficult to guess what's causing your problem.
--
Hope this helps
Arno R


Nov 12 '05 #4
"Arno R" <ar****************@tiscali.nl> wrote in message news:<3f**********************@dreader2.news.tisca li.nl>...
Bob,
If I understood you well then you said when you insert a msgbox "Done"
before docmd.Quit you have no problem?
Hence it still seems to me that Access is not finished with 'something'.
Again: Without more info on your code it's difficult to guess what's causing your problem.

Is this the "Access is executing steps asynchronously" trap? If so,
you may need ShellAndWait or a DoEvents command in there to allow the
copying or whatever to finish before you continue your code execution.
Heck, you could throw in a WAIT [n] command or something and which
would allow the other process to finish before finishing the series of
steps.
Nov 12 '05 #5
Thanks Pieter,
The wait routine (5 secs) did the trick nicely.

--
Bob Darlington
Brisbane
"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Arno R" <ar****************@tiscali.nl> wrote in message news:<3f**********************@dreader2.news.tisca li.nl>...
Bob,
If I understood you well then you said when you insert a msgbox "Done"
before docmd.Quit you have no problem?
Hence it still seems to me that Access is not finished with 'something'.
Again: Without more info on your code it's difficult to guess what's

causing your problem.

Is this the "Access is executing steps asynchronously" trap? If so,
you may need ShellAndWait or a DoEvents command in there to allow the
copying or whatever to finish before you continue your code execution.
Heck, you could throw in a WAIT [n] command or something and which
would allow the other process to finish before finishing the series of
steps.

Nov 12 '05 #6

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

Similar topics

0
by: SkySea | last post by:
Hi! Any help on this would be appreciated... In an HTML document that lists instructions on installing some software, there's a point where a DOS batch file needs to be run in order to copy...
4
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup)...
4
by: carrot | last post by:
With .Net Studio, I have a solution includes some projects. I want to execute a batch file during build solution time. For example, 1'st project is builded. 2'nd project is builded. " a batch...
0
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file...
6
by: Charles Neitzel | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
1
by: Charles | last post by:
I'm trying to write a windows application in C# (Using Microsoft Visual C# 2005 Express) that is nothing more than a simple UI with buttons on it. The buttons do various things like running...
7
by: David R. | last post by:
Hello all, I would like to generate a Sql-Script-File and a Batch-File to execute the Batch-File over C#-Code and use the SQL-File as an Input-File for the command "osql" in the Batch-File. I...
1
by: Crash | last post by:
Hi, ..NET v1.x SP1 VS 2003 SQL Server 2000 SP3 Server 2000, XP, Server 2003 I would like to programmatically execute {possibly many} SQL Server batch scripts. Aka I have many scripts that...
14
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.