|
-
Jan 19th, 2000, 01:00 AM
#1
Thread Starter
Lively Member
It goes like this: You can read parameter from command line with
Command()
Something like this:
Private Sub Form_Load()
par = Command 'parameter into variable
Set db = DBEngine.OpenDatabase(par)
End Sub
You can execute your program with command line:
myexe.exe c:\database.mdb
Vairable par get value " c:\database.mdb". I thing that you'll have to remove [space].
That must work.
Ermin
-
Jan 19th, 2000, 01:01 AM
#2
Hyperactive Member
like so:
dim strDatabase as string
strdatabase = command
Set db = DBEngine.OpenDatabase(strdatabase)
this assumes that you run the exe with the d:\database.mdb after it.
-
Jan 19th, 2000, 01:20 AM
#3
Thread Starter
Lively Member
I thing that must work.
you can also add character (/) in front of your parameter. Like this:
myapp.exe /c:\my_db.mdb
In your code you can find this character and everything behind is path and name of your database.
That is the cond from my program and it works. App accept two parameters:
Private Sub Form_Load()
dim par as string
par = Command
For i = 2 To Len(par)
If Mid(par, i, 1) = "/" Then
Label1(0).Caption = Mid(par, 2, i - 2)
Label1(1).Caption = Mid(par, i + 1)
Exit For
End If
Next i
end sub
command line is like this:
myapp.exe /c:\database.mdb /table_partner
Label1(0).Caption -> "c:\database.mdb"
Label1(1).Caption -> "table_partner"
Good luck!
Ermin
-
Jan 19th, 2000, 12:49 PM
#4
New Member
I need to pass the parameter "d:\Database.mdb" from the command line.
Not hard coded in the program like below code
Example
Set db = DBEngine.OpenDatabase("D:\Database.mdb")
Please Help.....Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|