Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry data source problem

    Hi, again.

    I have another script which the script refuses this local:

    Server.MapPath("/_private/lexicum.mdb")

    it wants for a local path: Server.MapPath("lexicum.mdb")

    This is the head of the script. I want to know WHY it does this? and how I do for it understand that databases path is :Server.MapPath("/_private/lexicum.mdb")

    <%

    intPage = Request("page")
    If isNumeric(intPage) = False Or intPage < 1 Then
    intPage = 1
    End If

    Dim SqlJunk


    Dim strDB, sSQL, dbGlobalWeb,con
    dbGlobalWeb.open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("/_private/lexicum.mdb")


    'Set dbGlobalWeb = Server.CreateObject("ADODB.Connection")
    'dbGlobalWeb.Open("Lexicum")

    'Dim dbGlobalWeb
    Set dbGlobalWeb = CreateObject("ADODB.Connection")
    ' con.Open strDB

    dbGlobalWeb.Open strdb
    'dbGlobalWeb
    'dbGlobalWeb.Open("Lexicum")



    SqlJunk = "SELECT * FROM ec" %>
    Thank you

    JL

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    the / at the start means it is starting from root (most likely C:\Inetpub\wwwroot\ but its acutally the root of the virtual directory)

    i start all my relative paths with ./

    . means current working directory
    .. means parent of current working directory, some servers have been set up to disable ..

    what does it output when you do
    Response.Write Server.MapPath("/_private/lexicum.mdb")


  •  

    Posting Permissions

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