need help with application path 
Author Message
 need help with application path

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.*-*-*.com/
Before you buy.



Wed, 10 Jul 2002 03:00:00 GMT  
 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.



Wed, 10 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Setting the path to the path of the current application

2. using application path (app.path)

3. Application Setup Wizard Says D:\<path>\D:\<path>\target.exe

4. Help!, VBA Application path property

5. HELP: How do I get a applications Path?

6. Help: Need dialog to select drive and directory path (not files)

7. Help needed getting full path from wdDialogFileSaveAs dialog

8. Need help: questions about path

9. App.Path command help needed!!!

10. Need Help with -Path Not Found- error message

11. Need help with Path Names

12. Need help with 'PATH'

 

 
Powered by phpBB® Forum Software