Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2003
    Location
    Leeds, West Yorkshire, UK
    Posts
    12

    Unanswered: Opening another Access 97 DB

    Could anyone help me with the code for opening another access 97 database.
    The problem i have is there are spaces in the path to the db and it doesn't like it.

    any suggestions would be much appreciated.

    cheers


    Pete

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Here is now I do this:

    stPath = stDirA & "MSACCESS.EXE /wrkgrp " + Chr(34) + _
    stDirS & "SYSTEM.MDW" + Chr(34) + " " + Chr(34)
    stAppName = stPath + Locate + "\" + stAppName + ".mde" '+ Chr(34) ' + " /excl"

    Call Shell(stAppName, 1)

    note that stDirA and stDirS are either looked up from a table or gotten using an input box or open dialog active X control. The Chr(34) put in double quotes so you can handle spaces like c:\program files\...

  3. #3
    Join Date
    Sep 2003
    Location
    Leeds, West Yorkshire, UK
    Posts
    12
    cheers mate much appreciated.

    will try the code and let you know if i'm a numpty or not...lol

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465
    You can do this too:

    Dim RetVal
    RetVal = Shell("C:\Archivos de programa\Microsoft Office\Office\MSAccess.exe C:\GralRoca\Agenmde.mde /x Ingreso", 1)
    Saludos
    Norberto

  5. #5
    Join Date
    Nov 2003
    Posts
    1,487
    The Shell function in Access does not like the Joliet (long file Name) format. Convert to the Short file name format (I can give you a function that does this). Basicly, if your file is named: This is my file Name.mdb then convert it to this: Thisis~1.mdb. First six characters (with no spaces) then a Tilde (~), and the the number one (1). Convert your folders as well if neccessary.

  6. #6
    Join Date
    Sep 2003
    Location
    Leeds, West Yorkshire, UK
    Posts
    12
    cheers everyone, i used jmrSudbury approach and it worked perfectly. cheers for your recommendations though.

    Pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •