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
|