Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pick up path to Access database directory from Ac

    I am trying to make the SysCmd function look in c:. What am I doing wrong?????

    'Pick up path to Access database directory from Access SysCmd function
    Set objAccess = Item.Application.CreateObject("Access.Application" )
    strAccessDir = objAccess.SysCmd(9)
    strDBName = strAccessDir & "cigarsiictl room.mdb"
    MsgBox "DBName: " & strDBName
    objAccess.Quit

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pick up path to Access database directory from Ac

    Never mind. I got it working.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Pick up path to Access database directory from Ac

    Daniel,

    I'm sure there are others out there who would be interested in how you got it working. Won't you share your solution?
    Charlotte

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Pick up path to Access database directory from Ac

    In the strAccessDir = objAccess.SysCmd(9) line I replace it with strAccessDir = "C:". This seemed to take care of my problem. I guess I tried to get to fancy and should have just kept it simple.

    'Pick up path to Access database directory from Access SysCmd function
    Set objAccess = Item.Application.CreateObject("Access.Application" )
    strAccessDir = "c:"
    strDBName = strAccessDir & "misccigarsiicontrol room.mdb"
    MsgBox "DBName: " & strDBName
    objAccess.Quit

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Pick up path to Access database directory from Ac

    Oh, then you weren't really looking for the Access directory (that is, the directory that contains MSAccess.exe) but a drive letter. No wonder the SysCmd was giving you problems.
    Charlotte

Posting Permissions

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