View Full Version : How to use Server.MapPath
I can only open the webpages through the FrontPage. I cannot know the physical path, and I want to put the Access database through the FrontPage. How can I connect this Access database? May I use Server.MapPath? If yes, how can I use it?:( :confused:
Server.Mappath() translates a Virutal path , into a Physical path.
So, if your database was in a directory called 'db' your code would look like:
Server.MapPath("db/myDatabase.mdb")
hth :)
Stealth
06-12-03, 12:07 PM
Or, to find out the physical path used.
<%
response.write request.ServerVariables("APPL_PHYSICAL_PATH")
%>
I'm the beginner of ASP, so would you pls explain it in details?:confused:
Thanks a lot!!
Stealth
06-16-03, 02:04 PM
request.ServerVariables("APPL_PHYSICAL_PATH") will return the physical path.
Physical being C:\website\files\
Virtual is the path from the current folder.
So if your file is in C:\website\ then the virtual (mappath) to access a database in C:\website\files\ is server.mappath("files/database.mdb")
hth
Stealth
vBulletin® v3.6.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.