Relative Path

B

blitzn

I have a Access 2007 Database (mdb) stored in the path C:\LAS\App_Data
I want a relative reference to images stored in the path C:\LAS\Images

I've tried "..\LAS\Images", "..\..\LAS\Images", "~\LAS\Images" to name a
few. I also tried the Application.CurrentProject.Path function - but this of
course returned "C:\LAS\App_Data".

I can't seem to find any help on this.

Thanks in advance for any thoughts.....
 
D

dymondjack

I haven't tried it but it came from a kb post from ms


Private Sub fnFolderParentFolderVB()
Dim objShell As Shell
Dim objFolder As Folder
Dim ssfPROGRAMS As Long

ssfPROGRAMS = 2
Set objShell = New Shell
Set objFolder = objShell.NameSpace(ssfPROGRAMS)
If (Not objFolder Is Nothing) Then
Dim objParentFolder As Folder

Set objParentFolder = objFolder.ParentFolder
If (Not objParentFolder Is Nothing) Then
Debug.Print objParentFolder.Title
End If
Set objParentFolder = Nothing
End If
Set objFolder = Nothing
Set objShell = Nothing
End Sub


http://msdn.microsoft.com/en-us/library/bb787880(VS.85).aspx


hth

--
Jack Leach
www.tristatemachine.com

- "Success is the ability to go from one failure to another with no loss of
enthusiasm." - Sir Winston Churchill
 
S

Stuart McCall

blitzn said:
I have a Access 2007 Database (mdb) stored in the path C:\LAS\App_Data
I want a relative reference to images stored in the path C:\LAS\Images

I've tried "..\LAS\Images", "..\..\LAS\Images", "~\LAS\Images" to name a
few. I also tried the Application.CurrentProject.Path function - but this
of
course returned "C:\LAS\App_Data".

I can't seem to find any help on this.

Thanks in advance for any thoughts.....

Use the CurDir function and you'll probably find that the path is not what
you expect. To ensure a correct relative path, change directory first. You
can use the ChDir statement for that:

ChDir "C:\LAS\App_Data"

Then:

...\Images

should work fine.
 
B

blitzn

Thank you, You were right the path was different than expected and this
solved my issue.

Cheers and Thanks Again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top