Application path 
Author Message
 Application path

I wish to reference an image file that is in the same
directory as the MS acccess application that is
distributed using a standard setup  - Given the
uncertainties of set up I do not know this directory in
advance.

How do I reference the file?

I have tried:

    If Right(App.Path, 1) = "\" Then
        objLic.ProductImage = App.Path & strImage
    Else
        objLic.ProductImage = App.Path & "\" & strImage
    End If

where objLic is an object whose property I am trying to
set, and where strImage is a string variable that
contains the file name.

This formulation works in VB6, but in access vb I am told
that I do not have the object - am I missing a library or
is there another object in access that I should be using?



Sat, 04 Jun 2005 23:36:49 GMT  
 Application path
strCurDir = CurrentProject.Path

Quote:
>-----Original Message-----
>I wish to reference an image file that is in the same
>directory as the MS acccess application that is
>distributed using a standard setup  - Given the
>uncertainties of set up I do not know this directory in
>advance.

>How do I reference the file?

>I have tried:

>    If Right(App.Path, 1) = "\" Then
>        objLic.ProductImage = App.Path & strImage
>    Else
>        objLic.ProductImage = App.Path & "\" & strImage
>    End If

>where objLic is an object whose property I am trying to
>set, and where strImage is a string variable that
>contains the file name.

>This formulation works in VB6, but in access vb I am
told
>that I do not have the object - am I missing a library
or
>is there another object in access that I should be using?

>.



Sun, 05 Jun 2005 00:34:04 GMT  
 Application path
If you're using A2K or later, you can use

    objLic.ProductImage = CurrentProject.Path & "\" & strImage

If you're using A97, you have to start with CurrentDb.Name and parse
the path out of it.  There's a cute trick to doing it with the Dir()
function, but I won't bother to post it unless you need it.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> I wish to reference an image file that is in the same
> directory as the MS acccess application that is
> distributed using a standard setup  - Given the
> uncertainties of set up I do not know this directory in
> advance.

> How do I reference the file?

> I have tried:

>     If Right(App.Path, 1) = "\" Then
>         objLic.ProductImage = App.Path & strImage
>     Else
>         objLic.ProductImage = App.Path & "\" & strImage
>     End If

> where objLic is an object whose property I am trying to
> set, and where strImage is a string variable that
> contains the file name.

> This formulation works in VB6, but in access vb I am told
> that I do not have the object - am I missing a library or
> is there another object in access that I should be using?



Tue, 07 Jun 2005 09:34:27 GMT  
 Application path
If I am understanding correctly, you want to know the Access application
path....not the currentdb or currentproject path.

You can use SysCmd(9) & "msaccess.exe"


Quote:
> I wish to reference an image file that is in the same
> directory as the MS acccess application that is
> distributed using a standard setup  - Given the
> uncertainties of set up I do not know this directory in
> advance.

> How do I reference the file?

> I have tried:

>     If Right(App.Path, 1) = "\" Then
>         objLic.ProductImage = App.Path & strImage
>     Else
>         objLic.ProductImage = App.Path & "\" & strImage
>     End If

> where objLic is an object whose property I am trying to
> set, and where strImage is a string variable that
> contains the file name.

> This formulation works in VB6, but in access vb I am told
> that I do not have the object - am I missing a library or
> is there another object in access that I should be using?



Tue, 07 Jun 2005 10:49:20 GMT  
 Application path
Whoops!  You may be right.  I've probably led Myles astray.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> If I am understanding correctly, you want to know the Access
application
> path....not the currentdb or currentproject path.

> You can use SysCmd(9) & "msaccess.exe"



> > I wish to reference an image file that is in the same
> > directory as the MS acccess application that is
> > distributed using a standard setup  - Given the
> > uncertainties of set up I do not know this directory in
> > advance.

> > How do I reference the file?

> > I have tried:

> >     If Right(App.Path, 1) = "\" Then
> >         objLic.ProductImage = App.Path & strImage
> >     Else
> >         objLic.ProductImage = App.Path & "\" & strImage
> >     End If

> > where objLic is an object whose property I am trying to
> > set, and where strImage is a string variable that
> > contains the file name.

> > This formulation works in VB6, but in access vb I am told
> > that I do not have the object - am I missing a library or
> > is there another object in access that I should be using?



Tue, 07 Jun 2005 11:11:05 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. using application path (app.path)

2. Help!, VBA Application path property

3. how to check application path?

4. Getting the application path

5. Finding Application path of VB .Net project

6. Finding the application path

7. Application path

8. Application Path question

9. application-path

10. Finding application path

11. need help with application path

12. Application Path Question

 

 
Powered by phpBB® Forum Software