PC Review Forums Newsgroups Microsoft Access Microsoft Access VBA Modules Access 97 command line switches

Reply

Access 97 command line switches

 
Thread Tools Rate Thread
Old 10-11-2003, 04:38 PM   #1
Patrick McGuire
Guest
 
Posts: n/a
Default Access 97 command line switches


I'm using an Access97 database as a front-end for
launching another Access97 database. I construct a
command string to use Shell(strCmd) where strCmd contains
the location of MSACCESS.exe, the database to launch, the
username and password, and the workgroup. I want to use
the UNC path for the workgroup file, since not all my
users are mapped identically. However, Access97's shell
command doesn't seem to like this. This strategy seems to
work fine with 2000 and 2002. Anybody know how to do what
I want to do in '97?

Thanks,

Pat
  Reply With Quote
Old 10-11-2003, 08:36 PM   #2
Dev Ashish
Guest
 
Posts: n/a
Default Re: Access 97 command line switches

"Patrick McGuire" <anonymous@discussions.microsoft.com> wrote in
news:096e01c3a7a0$a0363960$a401280a@phx.gbl:

> However, Access97's shell
> command doesn't seem to like this. This strategy seems to
> work fine with 2000 and 2002.


It would help if you provided the code you're using. In general, this
could be associated with spaces in folder names. Make sure that you double-
up the quotes around each option before calling Shell.

-- Dev
  Reply With Quote
Old 10-11-2003, 10:05 PM   #3
Patrick McGuire
Guest
 
Posts: n/a
Default Re: Access 97 command line switches

As it happens, it appears to be the presence of a dash (-)
in one of the folder names in the path. While the 2000
and XP versions handle the dash without a problem, I
needed to double up the dash to get the 97 version to
accept it.

>-----Original Message-----
>"Patrick McGuire" <anonymous@discussions.microsoft.com>

wrote in
>news:096e01c3a7a0$a0363960$a401280a@phx.gbl:
>
>> However, Access97's shell
>> command doesn't seem to like this. This strategy seems

to
>> work fine with 2000 and 2002.

>
>It would help if you provided the code you're using. In

general, this
>could be associated with spaces in folder names. Make

sure that you double-
>up the quotes around each option before calling Shell.
>
> -- Dev
>.
>

  Reply With Quote
Old 10-11-2003, 10:14 PM   #4
Dev Ashish
Guest
 
Posts: n/a
Default Re: Access 97 command line switches

"Patrick McGuire" <anonymous@discussions.microsoft.com> wrote in
news:04d001c3a7ce$5c5a7700$a101280a@phx.gbl:

> As it happens, it appears to be the presence of a dash (-)
> in one of the folder names in the path. While the 2000
> and XP versions handle the dash without a problem, I
> needed to double up the dash to get the 97 version to
> accept it.


That's strange; while I haven't worked with Access 97 in a while, I'm
pretty sure the only special chars the command line cares for (which you
need to double-up) are '/' and ';'.

-- Dev
  Reply With Quote
Old 11-11-2003, 05:28 PM   #5
Andy
Guest
 
Posts: n/a
Default Re: Access 97 command line switches

Here's some I code I use.

hth,
Andy


'---------------------------------------------------------------------------
-------
'sOpenMDB
'
'Purpose:
' This service opens another database.
'
'Parameters:
' strInMDB - Database to tbe opened
'
'Notes:
'
'
'Rev Num Date Author Description of Change
'------- -------- ------ ----------------------------------------------
-------
' 002 05/10/00 ash Use Shell vs SendKeys
' Clear the /CMD parameter
' 001 03/01/99 ash Code Courtesy of Dev Ashish
'---------------------------------------------------------------------------
-------
Public Sub sOpenMDB _
(strMdbPath As String, _
Optional Secured As Boolean = False, _
Optional strMdwPath As String)

On Error GoTo Err_sOpenDataBase

Dim rst As Recordset
Dim strAccess As String
Dim strCmd As String
Dim User As String

Const QS = """"

User = "Admin"

strAccess = SysCmd(acSysCmdAccessDir) & "MSACCESS.EXE"

strCmd = QS & strAccess & QS & " "

If User <> "Admin" Then
strCmd = strCmd & " /user " & QS & User & QS & " "
End If

If File_Exists(strMdwPath) Then
strCmd = strCmd & " /wrkgrp " & QS & strMdwPath & QS & " "
End If

strCmd = strCmd & QS & strMdbPath & QS & " /cmd "

Shell strCmd, vbNormalFocus

Application.Quit

Err_sOpenDataBase:
MsgBox Err.Description

End Sub


"Patrick McGuire" <anonymous@discussions.microsoft.com> wrote in message
news:096e01c3a7a0$a0363960$a401280a@phx.gbl...
> I'm using an Access97 database as a front-end for
> launching another Access97 database. I construct a
> command string to use Shell(strCmd) where strCmd contains
> the location of MSACCESS.exe, the database to launch, the
> username and password, and the workgroup. I want to use
> the UNC path for the workgroup file, since not all my
> users are mapped identically. However, Access97's shell
> command doesn't seem to like this. This strategy seems to
> work fine with 2000 and 2002. Anybody know how to do what
> I want to do in '97?
>
> Thanks,
>
> Pat



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off