Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Commandline parameters 1

Status
Not open for further replies.

NVSbe

Programmer
Sep 9, 2002
153
BE
Is it possible in Access 97 from commandline to add parameters, that can be called in the code?

For instance,
Code:
myDb.mdb x=10,y=11

I have been unable to find anything, so I doubt it's possible, but, who knows...

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Don't know if this works in A97, but it does work in later versions. It requires two things, first, that the command line NOT be to the MDB, but to MSAccess with the MDB as a parameter, with additional parameters after the ; which follows the MDB name. Something like the following:
Code:
"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE" C:\DirName\SubDir\MyDatabase.mdb ; 10 11 12
Next, in the Form_Load event of the startup form, drop in the following code:
Code:
Private Sub Form_Load()
   
   Dim CommandLine   As String
   
   CommandLine = Command()
   MsgBox CommandLine
   ...

End Sub
For the above command line, the variable CommandLine will contain "10 11 12". Of course it will be up to you to parse out and handle the individual parameters.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I wonder if this works in A97?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Hi Canjun. Thank you for your suggestion. I did not try this yet, because I found another option that did work.

As you said, you need the path to msaccess, and then you can add: /cmd "yourstringhere".

In the program then, the output of the function Command(), is "yourstringhere".

I'll give your solution a try tomorrow. I'll post if it works.

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Since it may be of interest to others who are using A97, perhaps you'd be so kind as to post the other option that does work.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Hi CajunCenturion. Need some more coffee ? ;-)
NVSbe posted the other option:
NVSbe said:
As you said, you need the path to msaccess, and then you can add: /cmd "yourstringhere".
In the program then, the output of the function Command(), is "yourstringhere".

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Isn't that what I posted as my first suggestion? The only difference being I substituded the ; for the /cmd, both of which do exactly the same thing?

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
I didn't know ; and /cmd did the same. But yes, it does work.

--------------------------------------
It's not the monsters under your bed, it is the men next door.
That make you fear, make you cry. Make you cry for the Child.
All the wars are fought amongst those lonely men. Unharmed, unscarred.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top