PC Review


Reply
Thread Tools Rate Thread

Access 97 command line switches

 
 
Patrick McGuire
Guest
Posts: n/a
 
      10th Nov 2003
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
 
 
 
 
Dev Ashish
Guest
Posts: n/a
 
      10th Nov 2003
"Patrick McGuire" <(E-Mail Removed)> wrote in
news:096e01c3a7a0$a0363960$(E-Mail Removed):

> 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
 
Patrick McGuire
Guest
Posts: n/a
 
      10th Nov 2003
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" <(E-Mail Removed)>

wrote in
>news:096e01c3a7a0$a0363960$(E-Mail Removed):
>
>> 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
 
Dev Ashish
Guest
Posts: n/a
 
      10th Nov 2003
"Patrick McGuire" <(E-Mail Removed)> wrote in
news:04d001c3a7ce$5c5a7700$(E-Mail Removed):

> 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
 
Andy
Guest
Posts: n/a
 
      11th Nov 2003
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" <(E-Mail Removed)> wrote in message
news:096e01c3a7a0$a0363960$(E-Mail Removed)...
> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command-line switches rjchaney Microsoft Outlook VBA Programming 0 23rd Mar 2009 11:18 PM
Command-Line Switches =?Utf-8?B?bWNhbGRlcg==?= Spyware Discussion 2 28th Mar 2007 03:59 AM
Runtime mode and command line switches with Access automation? bobc@4bcx.com Microsoft Access 0 10th Mar 2006 07:56 PM
Command line switches. Jarryd Microsoft Excel Programming 3 1st Dec 2005 11:06 PM
Hyperlinks to Access Database with Command Line Switches =?Utf-8?B?RGo=?= Microsoft Frontpage 1 3rd Nov 2005 11:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 AM.