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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I start an Access97 app from my VB6 prog and pass parameters

Status
Not open for further replies.

goldi

Programmer
Mar 21, 2001
31
US
I have a little VB6 program that does quick client lookups. I would like to be able to lookup a client in the VB program (which asks for a user signon and password) then click a button to start the existing Access program and pass the user signon, password and client ID to it. is this possible?

The Access program is used on it's own and asks for the same user signon and password.
 
If you are able to do this from the command prompt.
myDB.mdb username password
then you would be able to run this from VB

SHELL("myDB.mdb " & strUser & " " & password)
Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
I hope my post was helpful!!!
 
I put the shell command in my VB:

Shell ("O:\System Ver 1.39\SOURCE CODE\System.mdb" & " " & strSignon & " " & strPassword & " " & lngCaseNo)

but I get "file not found" when I try to do that command
 
Try quotes around the program name inside the string.
Shell ("""O:\System Ver 1.39\SOURCE CODE\System.mdb""" & " " & strSignon & " " & strPassword & " " & lngCaseNo)
Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
I have found the solution. Thank you both for pointing me in the right direction.

Here is what I came up with:

dim strShell as string
dim retVal

strShell = """C:\Program Files\Microsoft Office\Office\MSACCESS.EXE""" & " " & """C:\Program Files\System\System-fe.mde""" & " /cmd " & strSignon & " " & strPassword & " " & Me.txtCaseNo

If Me.txtCaseNo.Text > "" Then
retVal = Shell(strShell, 3)
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top