Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    File/Folder paths (2000 (9.0.4402 SR-1))

    I need to be able to pick up the file path of where the Access DB is residing. I used to be able to do this ok when using DAO, i.e. I would do the following:-

    Dim db As DAO.Database
    Dim strfilepath As String

    Set db = CurrentDb
    strfilepath = db.Name

    This would return the full path of the DB's location:- Q:LloydsGreenwich2003 Q4994i - FSA return994_2003 Dec03.mdb

    However, using ADODB, this no longer works.

    The only alternative I can seem to find at present is the following:

    Dim dbs1 As ADODB.Connection
    Set dbs1 = CurrentProject.Connection

    Which when interrogated gives me:
    Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=Q:CotesworthAscotPremIncomeDatabasesPremium Income Monitoring.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database=C:PROGRAM FILESCOMMON FILESSYSTEMSYSTEM.MDW;Jet OLEDB:Registry Path="";Jet OLEDBatabase Password="";Jet OLEDB:Engine Type=5;Jet OLEDBatabase Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False

    Which as you can see is far too much information!

    How can I just pull the file path alone?

    Cheers,

    Niven <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: File/Folder paths (2000 (9.0.4402 SR-1))

    CurrentProject.FullName returns the same as CurrentDb.Name: the complete path + file name.
    CurrentProject.Path returns only the path.
    CurrentProject.Name returns only the file name.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2003
    Location
    London, Gtr London, England
    Posts
    222
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File/Folder paths (2000 (9.0.4402 SR-1))

    Superb!

    Thanks very much for that, just what I was looking for!

    Cheers,

    Niven <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

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