Get the path of a virtual subsubfolder

  • Thread starter Thread starter And
  • Start date Start date
A

And

Hi everyone my database is in a folder inside the inetpub folder
(c:\inetpub\bd\mydatabase.mdb) and my web application is in a folder inside
the wwwroot folder.

My question is:

Is there a way of accessing my database using virtual directories, that is,
for example if I was using html I could achieve this putting
"..\..\bd\mydatabase.mdb".

I tried to do this using mappath function but with no good result.



Thanks in advance

And
 
does it work correctly with full path "c:\sdfs\sdfsdf\sdfs\file.mdb"
What's the error?
 
Is there a way of accessing my database using virtual directories, that
is,
for example if I was using html I could achieve this putting
"..\..\bd\mydatabase.mdb".

I tried to do this using mappath function but with no good result.

Yes, Server.MapPath works. I will post the code if you post the following:

- The directory that your file resides in
- The full virtual path of your virtual directory (ie /data/bd/ )

I assume the physical path = c:\inetpub\bd\mydatabase.mdb


Jeremy
 
This is the full address to my file
C:\Inetpub\wwwroot\Teste29_06_2004\myfile.aspx

and my database full address is (as you were thinking)
c:\inetpub\bd\mydatabase.mdb

PS: tks Jeremy for spend some time with my post
 
As I said I tried a lot of things and none of them worked or the path I get
wasn't the one I expected so the error depends on what I enter as argument
in the mappath directory but the most common error says that the mappath
argument must be a valid virtual path
 
And what about the virtual directory? That's the important one, here is
what I need:

(web paths, not full physical)

My file: /Test/Myfile.aspx
Virtual directory: /Test/VirtualDir/
Code: Server.MapPath("VirtualDir/")

or if you are in a higher directory:

MyFile: /Test/Something/MyFile.aspx
Virutal: /VirtualDir/
Code: Server.MapPath("../../VirtualDir/")

You are probably just getting the virtual path (the one that gets sent into
MapPath) wrong.

Jeremy
 
Hi Jeremy tks for your patience!

In fact I didn't understood what was really a virtual folder and was your
post that remind me that.

I made a search in the www and finally understood my real problem and I
fixed it.



Once again

tks
 
Back
Top