Solved

open a .mdb from a  batch file using the Start command

Posted on 2000-04-17
8
1,497 Views
Last Modified: 2008-03-06
I am trying to start multiple instances of Access from a batch file (different mdbs) so they all run at the same time,
 using the standard:
 [path to Access] [path to mdb] /cmd[stuff as string] eg:"C:\MSAccess.exe" "C:\database.mdb" /cmd "parameters"

repeated for each mdb. works fine in Win95 they all open and operate together but NT waits till the first instance of Access has closed before executing the next command, the way a batch file is suposed to work. SOmeone suggested using the START command (which opens a new dos box then executes the passed command line)eg:

START "C:\Msaccess.exe" "C:\database.mdb" /cmd "parameters"

This opens mutiple instances together but Access igonores the /cmd switch, I think that NT thinks that the /cmd is a Start command switch. Iv'e tried enclosing different bits in "" but no success.

Please help me

G
0
Comment
Question by:G_Thompson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 1

Accepted Solution

by:
Phoat earned 60 total points
ID: 2723156
you could try using different batch files for each instance of access you want to run, then accessing those batch files with one main one.  

Since i dont know anything about NT, that's the only suggestion i could give.  Hope it helps

Phoat
0
 
LVL 10

Expert Comment

by:paasky
ID: 2723232
Hello G_Thompson,

I tried parameter passing with shell() function and it was working fine with my NT workstation. Here's the test code:

Sub SomeTest()
    Dim RetVal As Variant
    Dim instance As Integer
    Dim PathName As String
   
    PathName = Chr(34) & "C:\Program Files\Microsoft Office\Office\msaccess.exe" & Chr(34) & " " & Chr(34) & "c:\temp\x.mdb" & Chr(34) & " /cmd hello world wide web"
   
    For instance = 1 To 3
        RetVal = Shell(PathName, vbNormalNoFocus)
    Next
   
End Sub

Hope this helps,
Paasky
0
 
LVL 10

Expert Comment

by:paasky
ID: 2723241
Hello G_Thompson,

I tried parameter passing with shell() function and it was working fine with my NT workstation. Here's the test code:

Sub SomeTest()
    Dim RetVal As Variant
    Dim instance As Integer
    Dim PathName As String
   
    PathName = Chr(34) & "C:\Program Files\Microsoft Office\Office\msaccess.exe" & Chr(34) & " " & Chr(34) & "c:\temp\x.mdb" & Chr(34) & " /cmd hello world wide web"
   
    For instance = 1 To 3
        RetVal = Shell(PathName, vbNormalNoFocus)
    Next
   
End Sub

Hope this helps,
Paasky
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 10

Expert Comment

by:paasky
ID: 2723256
(sorry double posting - poor connection combined with impatient expert)
0
 

Author Comment

by:G_Thompson
ID: 2723260
It would be nice to have them all from one batch file but it works, thanks :)
0
 

Author Comment

by:G_Thompson
ID: 2723299
Thanks, but not quite what I'm after.Passky Passing parameters works fine , unless you use the Dos Start command from a batch file(at least as far as I could tell). I want to call several copies at the same time (how on earth do you spell simultainiously? :) calling the mdb's from a batch file NT waits until the first instance of Access (with the first mdb) is closed before it executes the second line, which is supposed to open the second mdb.
Using the Start command in a batch file executes each line one after the other without waiting for the first process to finish(As in Win95) Just what I want but I could not get the Start command to open access with /cmd parameters.

Basicly it's  not a problem with passing /cmd in NT just passing them through the start command. I hope this explains it.

G
0
 

Author Comment

by:G_Thompson
ID: 2723308
The first comments for Phoat the 2nd for Paasky.
0
 
LVL 10

Expert Comment

by:paasky
ID: 2723334
G_Thompson, you have some other commands in batch files you wanted also execute and starting Access database with command parameters was not enough?

Some things work differently in Win95/98 and WinNT, batch script running is one of them. Well, that keeps us developers busy testing all applications in all win systems... ;-)

Glad your problem is solved.

Regards,
Paasky
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question