A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to start and Access DB from a bat-file



 
 
Thread Tools Display Modes
  #1  
Old April 8th, 2010, 12:34 PM posted to microsoft.public.access
DianePDavies
external usenet poster
 
Posts: 76
Default How to start and Access DB from a bat-file

What would the command line be to start a specific Access DB from a bat-fil?
--
Diane
  #2  
Old April 8th, 2010, 12:52 PM posted to microsoft.public.access
Paul Shapiro
external usenet poster
 
Posts: 635
Default How to start and Access DB from a bat-file

"DianePDavies" wrote in message
...
What would the command line be to start a specific Access DB from a
bat-fil?


Start "YourWindowTitle" "C:\YourDataFolder\YourDB.mdb"

The double-quotes are needed if your arguments contain any spaces, but
including them is ok either way.

  #3  
Old April 8th, 2010, 12:57 PM posted to microsoft.public.access
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default How to start and Access DB from a bat-file

hi Diane,

On 08.04.2010 13:34, DianePDavies wrote:
What would the command line be to start a specific Access DB from a bat-fil?

start "FullPath\Database.mdb"

For further control of Access from the command line, take a look at

http://support.microsoft.com/kb/209207

The command line in general:


http://www.microsoft.com/resources/d...us/ntcmds.mspx

http://commandwindows.com/


mfG
-- stefan --
  #4  
Old April 12th, 2010, 03:34 PM posted to microsoft.public.access
DianePDavies
external usenet poster
 
Posts: 76
Default How to start and Access DB from a bat-file

Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as A.mde and
then not adress A.mde with a full path - similarly I would like to start
MSACCESS.EXE without a full path.

If I can do that I dont need to worry about the specific location on the
various user PCs. I believe there is a constant for the path to
office-programs... and I would assume it is possible to address A.mde locally?

Any suggestions?


--
Diane


"Stefan Hoffmann" wrote:

hi Diane,

On 08.04.2010 13:34, DianePDavies wrote:
What would the command line be to start a specific Access DB from a bat-fil?

start "FullPath\Database.mdb"

For further control of Access from the command line, take a look at

http://support.microsoft.com/kb/209207

The command line in general:


http://www.microsoft.com/resources/d...us/ntcmds.mspx

http://commandwindows.com/


mfG
-- stefan --
.

  #5  
Old April 12th, 2010, 03:49 PM posted to microsoft.public.access
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default How to start and Access DB from a bat-file

hi Diane,

On 12.04.2010 16:34, DianePDavies wrote:
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as A.mde and
then not adress A.mde with a full path - similarly I would like to start
MSACCESS.EXE without a full path.

You always need to specifiy the full path to Access except in one case:

If you don't care which possible installed Access version is used then
you may simply use

Start "C:\DEMO\A.mde"

in your batch.

You may omit the path to the database file, but then your batch does not
work under some circumstances, e.g.

Store your batch under C:\DEMO\Test.cmd with Start A.mde command line.
Open a command line window and switch to the root, C:\.
On C:\ execute your batch:

C:\\Demo\Test.cmd

This will fail due to the wrong current working directory.


mfG
-- stefan --
  #6  
Old April 13th, 2010, 10:29 AM posted to microsoft.public.access
DianePDavies
external usenet poster
 
Posts: 76
Default How to start and Access DB from a bat-file

Now I have the problem that my batch-file stays open while the database is
open. When I shut down the database the command prompt shuts down too - or if
I click the "x" in the top right corner - but I would like it to close right
after the command to start the database.

How is that done?
--
Diane


"Stefan Hoffmann" wrote:

hi Diane,

On 12.04.2010 16:34, DianePDavies wrote:
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE" "C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as A.mde and
then not adress A.mde with a full path - similarly I would like to start
MSACCESS.EXE without a full path.

You always need to specifiy the full path to Access except in one case:

If you don't care which possible installed Access version is used then
you may simply use

Start "C:\DEMO\A.mde"

in your batch.

You may omit the path to the database file, but then your batch does not
work under some circumstances, e.g.

Store your batch under C:\DEMO\Test.cmd with Start A.mde command line.
Open a command line window and switch to the root, C:\.
On C:\ execute your batch:

C:\\Demo\Test.cmd

This will fail due to the wrong current working directory.


mfG
-- stefan --
.

  #7  
Old April 13th, 2010, 11:04 AM posted to microsoft.public.access
Stefan Hoffmann
external usenet poster
 
Posts: 991
Default How to start and Access DB from a bat-file

hi Diane,

On 13.04.2010 11:29, DianePDavies wrote:
Now I have the problem that my batch-file stays open while the database is
open. When I shut down the database the command prompt shuts down too - or if
I click the "x" in the top right corner - but I would like it to close right
after the command to start the database.

I wonder if you're heading into the right direction with a batch.

What are you trying to achieve? Have you considered using a simple link
instead of a batch?

Maybe you using a front-end update tool like

http://autofeupdater.com/

is what you need.


mfG
-- stefan --

  #8  
Old April 13th, 2010, 01:58 PM posted to microsoft.public.access
Paul Shapiro
external usenet poster
 
Posts: 635
Default How to start and Access DB from a bat-file

What exact command(s) did you use in the batch file? I have many clients
using the Start command that Stefan listed below, and the command window
closes as soon as the call to start the db is processed.

If you're copying the current frontend and then starting it up, there should
be two commands in the batch file:
copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde"
Start "C:\DEMO\A.mde"

"DianePDavies" wrote in message
...
Now I have the problem that my batch-file stays open while the database is
open. When I shut down the database the command prompt shuts down too - or
if
I click the "x" in the top right corner - but I would like it to close
right
after the command to start the database.

How is that done?
--
Diane


"Stefan Hoffmann" wrote:

hi Diane,

On 12.04.2010 16:34, DianePDavies wrote:
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE"
"C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as
A.mde and
then not adress A.mde with a full path - similarly I would like to
start
MSACCESS.EXE without a full path.

You always need to specifiy the full path to Access except in one case:

If you don't care which possible installed Access version is used then
you may simply use

Start "C:\DEMO\A.mde"

in your batch.

You may omit the path to the database file, but then your batch does not
work under some circumstances, e.g.

Store your batch under C:\DEMO\Test.cmd with Start A.mde command line.
Open a command line window and switch to the root, C:\.
On C:\ execute your batch:

C:\\Demo\Test.cmd

This will fail due to the wrong current working directory.


mfG
-- stefan --


  #9  
Old April 19th, 2010, 03:45 PM posted to microsoft.public.access
DianePDavies
external usenet poster
 
Posts: 76
Default How to start and Access DB from a bat-file

If my command looks exactly like you suggest:

start "C:\DEMO\A.mde"

I just open a command prompt with the title "C:\DEMO\A.mde"

If I have the following:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\DEMO\A.mde"

This starts my database but the command prompt stays open until I close the
databas (or exits the prompt manually by clicking the "x" in the corner).

--
Diane


"Paul Shapiro" wrote:

What exact command(s) did you use in the batch file? I have many clients
using the Start command that Stefan listed below, and the command window
closes as soon as the call to start the db is processed.

If you're copying the current frontend and then starting it up, there should
be two commands in the batch file:
copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde"
Start "C:\DEMO\A.mde"

"DianePDavies" wrote in message
...
Now I have the problem that my batch-file stays open while the database is
open. When I shut down the database the command prompt shuts down too - or
if
I click the "x" in the top right corner - but I would like it to close
right
after the command to start the database.

How is that done?
--
Diane


"Stefan Hoffmann" wrote:

hi Diane,

On 12.04.2010 16:34, DianePDavies wrote:
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE"
"C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as
A.mde and
then not adress A.mde with a full path - similarly I would like to
start
MSACCESS.EXE without a full path.
You always need to specifiy the full path to Access except in one case:

If you don't care which possible installed Access version is used then
you may simply use

Start "C:\DEMO\A.mde"

in your batch.

You may omit the path to the database file, but then your batch does not
work under some circumstances, e.g.

Store your batch under C:\DEMO\Test.cmd with Start A.mde command line.
Open a command line window and switch to the root, C:\.
On C:\ execute your batch:

C:\\Demo\Test.cmd

This will fail due to the wrong current working directory.


mfG
-- stefan --


.

  #10  
Old April 20th, 2010, 01:08 AM posted to microsoft.public.access
Paul Shapiro
external usenet poster
 
Posts: 635
Default How to start and Access DB from a bat-file

Sorry, I think there's a parameter omitted from the Start command.

start "My Window Name" "C:\DEMO\A.mde"

You can get the full documentation for the start command by typing
help start
in a command window.

An excerpt from the help:
Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/i] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/AFFINITY hex affinity] [/WAIT] [/b] [command/program]
[parameters]

"title" Title to display in window title bar.
path Starting directory.

"DianePDavies" wrote in message
...
If my command looks exactly like you suggest:

start "C:\DEMO\A.mde"

I just open a command prompt with the title "C:\DEMO\A.mde"

If I have the following:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "C:\DEMO\A.mde"

This starts my database but the command prompt stays open until I close
the
databas (or exits the prompt manually by clicking the "x" in the corner).

--
Diane


"Paul Shapiro" wrote:

What exact command(s) did you use in the batch file? I have many clients
using the Start command that Stefan listed below, and the command window
closes as soon as the call to start the db is processed.

If you're copying the current frontend and then starting it up, there
should
be two commands in the batch file:
copy /y "\\MyServer\MyPath\A.mde" "C:\Demo\A.mde"
Start "C:\DEMO\A.mde"

"DianePDavies" wrote in message
...
Now I have the problem that my batch-file stays open while the database
is
open. When I shut down the database the command prompt shuts down too -
or
if
I click the "x" in the top right corner - but I would like it to close
right
after the command to start the database.

How is that done?
--
Diane


"Stefan Hoffmann" wrote:

hi Diane,

On 12.04.2010 16:34, DianePDavies wrote:
Now it works with:
"C:\Program Files\Microsoft Office\OFFICE11 \MSACCESS.EXE"
"C:\DEMO\A.mde"

However - I would like to place the bat-file in the same folder as
A.mde and
then not adress A.mde with a full path - similarly I would like to
start
MSACCESS.EXE without a full path.
You always need to specifiy the full path to Access except in one
case:

If you don't care which possible installed Access version is used then
you may simply use

Start "C:\DEMO\A.mde"

in your batch.

You may omit the path to the database file, but then your batch does
not
work under some circumstances, e.g.

Store your batch under C:\DEMO\Test.cmd with Start A.mde command line.
Open a command line window and switch to the root, C:\.
On C:\ execute your batch:

C:\\Demo\Test.cmd

This will fail due to the wrong current working directory.


mfG
-- stefan --


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.