?
Solved

App.Path in vba?

Posted on 2003-11-03
8
Medium Priority
?
1,153 Views
Last Modified: 2008-03-06
How would I ask access what my DB path is? like App.Path is vb?

   - Marc
0
Comment
Question by:MarcGraff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 8

Expert Comment

by:Benjamin_Luk
ID: 9676389
Please try following code to find the db path:

Function FindMyFile()
Dim i As Integer
With Application.FileSearch
.NewSearch
    .LookIn = "C:\Scratch\Data"  'Search path
    .SearchSubFolders = True
    .FileName = "*.dbf" 'Here to set the file type or name
    .MatchTextExactly = True
    .FileType = msoFileTypeAllFiles
    If .Execute() > 0 Then
        MsgBox "There were " & .FoundFiles.Count & _
            " file(s) found."
        For i = 1 To .FoundFiles.Count
            MsgBox .FoundFiles(i)
        Next i
    Else
        MsgBox "There were no files found."
    End If
End With
End Function

Regards

Ben
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 9676532
currentproject.path

Pete
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9678272
Pete's suggestion is great for v2000 and above.

for 97 you can ...

Left$(CurrentDB.Name, Len(CurrentDB.Name) - Len(Dir(CurrentDB.Name)))

Steve
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Expert Comment

by:SoggyP
ID: 9678316
Hi Folks,

Can't you use just use currentdb.name and extract the lefthand side of the string?

Later,

Jes
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9678405
Hi Jes,  that is what my post does ...
0
 

Expert Comment

by:SoggyP
ID: 9678438
Hi Folks,

@Steve:  Oh, alright then, you got there first ;0)

Jes
0
 
LVL 39

Expert Comment

by:stevbe
ID: 9678471
sometimes it take a while for the system to post , catch up, email ... I get dizzy myself just following the threads sometimes :-)
0
 
LVL 1

Author Comment

by:MarcGraff
ID: 9678537
Thanks everyone!

   - Marc
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question