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

Open 2007 Db using "Shell" command

Status
Not open for further replies.

batteam

Programmer
Sep 12, 2003
374
US
I am attempting to open a .accdb database using the following commands:
myshell = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE" & " " & myFile

then:

myAppID = Shell(myshell, vbMaximizedFocus)


myFile is a valid path and .accdb database name. I get the error: "The command line you used to start Microsoft Access contains an option that Microsoft Access does not recognize..."

This command line opens Microsoft Access projects (.adp) all day long. Anybody have any ideas why I'm getting this error when trying to open a .accdb file?

Thanks for your help.
 
How are ya batteam . . .

... and this:
Code:
[blue]   Dim DQ As String
   
   DQ = """"

   myShell = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE " & _
             DQ & myFile & DQ[/blue]
I have no idea what your trying to do with the 2nd [blue]Shell[/blue] statement.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks, TheAceMan1, it worked, but only after I executed the 2nd shell line of code. If I don't do that, nothing opens. From some of the help sites I've looked at, that 2nd line of code is needed. But thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top