
need help with application path
Frank,
Use App.Path. For example:
myDBName = App.Path & "\inventory.mdb"
Be aware that App.Path does not return an ending backslash, EXCEPT if the
path is the root directory. So to be complete you should really do this:
Dim myPath as String
myPath = App.Path
If Right(myPath, 1) <> "\" Then
myPath = myPath & "\"
end if
myDBName = myPath & "Inventory.mdb"
Hope this helps,
Kerry Moorman
Quote:
>I created a vb 6 application and an installation program. The way I
>have it now is that it will only work if installed into a specific
>directory on the c: drive. Because that is where the data must be due
>to the references to it in the code such as ...c:\vbapp\inventory.mdb
>How can I change this reference so it will work wherever the user
>chooses to install it? for example....c:\program files\vbapp
>THanks
>Frank
>Sent via Deja.com http://www.deja.com/
>Before you buy.