Results 1 to 2 of 2

Thread: Server.MapPath

  1. #1
    Karen L. Guest

    Default Server.MapPath

    How can I do this using Server.MapPath?<BR><BR>Session.Timeout = 15<BR>set oConn=Server.CreateObject("ADODB.connection")<BR>s et oRS=Server.CreateObject("ADODB.recordset")<BR>strS ource = "Driver={Microsoft dBase Driver (*.dbf)}"<BR>strSource=strSource& ";DBQ=f:InetPubwwwAccountslistDocs.dbf"<BR>oConn.C onnectionString = strSource<BR>Response.Write"&#060;HR&#062;" & strSource & "&#060;HR&#062;"<BR>oConn.Open<BR><BR>sqltext = "SELECT Station, clock "<BR>sqltext = sqltext & " FROM [DB01];" &#039WHERE area=3;"<BR>oRs.Open sqltext, oConn

  2. #2 Guest

    Default RE: Server.MapPath

    Instead of the following line :<BR>strSource=strSource& ";DBQ=f:InetPubwwwAccountslistDocs.dbf"<BR>you would have:<BR><BR>strSource=strSource& ";DBQ=" & server.mappath("/Accounts/list/Docs.dbf")<BR><BR>where the path is the virtual path to the file you wish to access, instaed of the filesystem path that you are using. The advantage is that you can test your ASP app on a local server, and then when you publish the pages you don&#039t have to change the physical path spec to access the file when it is on the internet. Also if your hosting company decides to rearrange there folders it won&#039t affect you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts