Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server.MapPath

Status
Not open for further replies.

tamethetikbalang

Programmer
Aug 24, 2003
34
0
0
PH
for example I have a database.mdb on the LAN. the path is \\North\NORTH\database.mdb what should I put in the server.MapPath?

this is what I did
set conn=server.CreateObject ("adodb.connection")
connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\\north\NORTH\databse.mdb") & ";Persist Security Info=False"
conn.Open connect

but i get this error
Server.MapPath(), ASP 0174 (0x80004005)
An invalid '/' or '\' was found in the Path parameter for the MapPath method.
 
The Server.MapPath method is used relative to where your ASP file is located. Unless your ASP file is located somewhere in that same LAN directory, then you might want to use the actual path name, not the Server.MapPath method. For more help with this, you can try here: DevGuru

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Actually, Server.MapPath resolves a virtual path from anywhere in your web paths to an actual path name., not necessraally just the path the current page. Although, even with this slightly more generalized description, it is still not for use in mapping to other folders on the network.
Your best bet may be to just map a drive and point at that. I won't get into the efficiency issues here, but it should work that wayt as long as you se up the permissions on the mapped drive correctly for your IUSR_machinename account (generic IIS account).

-T

barcode_1.gif
 
Thanks for the correction, Tarwn! [thumbsup]

------------------------------------------------------------------------------------------------------------------------
If you don't have a sense of humor, you probably don't have any sense at all.
- Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top