Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Virtual Path

    Hi, I have an application with a connection.asp document linking to the MS
    Access database Previously I have had the database ABOVE the ROOT and all was
    working fine.. I have shifted the database BELOW the ROOT and I am tryin gto
    get the virtual path right in the connection.asp document The inital code
    datasourcename='Driver={Microsoft Access Driver (*.mdb)}; DBQ=' &
    Server.MapPath('database/databasename.mdb') the physical path is (on the BELOW
    database) d:\hshome\jimglass\database\databasename.mdb I have tried all the
    combinations I thn possible... any IDEAS :) Thanks

    Ken_iversen Guest

  2. Similar Questions and Discussions

    1. Jrun virtual-mapping to UNC path
      Is it possible to set the <virtual-mapping><system-path> in the jrun-web.xml file to point to a UNC path? I want all of the .cfm files to reside...
    2. #26186 [Bgs]: include_path ignored using include with virtual path
      ID: 26186 User updated by: jon at banton dot plus dot com Reported By: jon at banton dot plus dot com Status: Bogus...
    3. virtual path problem
      hi, I have a script in a folder which simply creates a file in another dump folder /myscript/script.php /myscript/dumpfolder/ but then i...
    4. Virtual Path from a class Object
      An object resides in memory. As such, there is no path, virtual or otherwise to it. -- HTH, Kevin Spencer Microsoft MVP ..Net Developer...
    5. Convert Physical path to Virtual path?
      We have a field that gets filled into a database that our ASP website pulls from. What we would like to be able to do is to take that path and...
  3. #2

    Default Re: Virtual Path

    Instead of using Server Mappath you can simply create a version of your
    connection file for the live site and use

    d:\hshome\jimglass\database\databasename.mdb

    Originally posted by: Ken_iversen
    Hi, I have an application with a connection.asp document linking to the MS
    Access database Previously I have had the database ABOVE the ROOT and all was
    working fine.. I have shifted the database BELOW the ROOT and I am tryin gto
    get the virtual path right in the connection.asp document The inital code
    datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    Server.MapPath("database/databasename.mdb") the physical path is (on the BELOW
    database) d:\hshome\jimglass\database\databasename.mdb I have tried all the
    combinations I thn possible... any IDEAS :) Thanks



    CarlGrint Guest

  4. #3

    Default Re: Virtual Path

    Hi, Carl I did not write the application, but bougt the code as is.. so
    needless to say, I am not an .asp programmer :) The entire application relies
    on this connection.asp document, so I am not sure how to build my own
    connection file to fit?? Do I simply change the statement within the existing
    file? Cheers for your input anyway..

    <%
    '===============================================
    ' (C) 2004 Radiant Software, Inc. Version 2.4
    ' Email Contact: [email]Personals@TestPersonals.com[/email]
    ' Parts of this code were developed by Duware.com
    '===============================================
    ' - EDIT BELOW -
    '================================================= =======
    'The system should work right out of the box the way it
    'is setup here. Please keep in mind that this is a easy
    'install but not very secure. Anyone who knows the
    'location of your DB can download it and get the admin
    'password. It is a good idea to move the DB to a folder
    'that can not be accessed by the web or the IIS
    'anonymous user.
    '================================================= =======

    'MS Access Connection String
    'datasourcename="yourdsn"

    'MS Access Connection String
    datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    Server.MapPath("database/personals24.mdb")

    ' - DO NOT EDIT BELOW -

    if NOT request.cookies("rest") = "" then
    id = request.cookies("rest")
    response.redirect("restricted.asp?idd=") & id
    end if

    Response.Buffer = True
    Response.ExpiresAbsolute = Now() - 10
    Response.Expires = -1000
    Response.CacheControl = "no-cache"

    'Dim pathtodatabase
    Dim datasourcename
    Dim DBtype
    Dim cursortype
    Dim MM_conn_STRING
    Dim cmdTemp
    Dim rs_main
    Dim rs_main2
    Dim rsSession
    Dim rsSession_numRows
    Dim rsSession__MMColParam
    Dim rs125
    Dim rs125_numRows


    '-----------------------------------------------
    'DATABASE CONNECTION SETTINGS
    '-----------------------------------------------
    Set MM_conn_STRING = Server.CreateObject("ADODB.Connection")
    MM_conn_STRING.Open datasourcename
    Set cmdTemp = Server.CreateObject("ADODB.Command")
    Set rs_main = Server.CreateObject("ADODB.Recordset")
    Set rs_main2 = Server.CreateObject("ADODB.Recordset")

    If (Session("MM_Username") <> "") Then
    rsSession__MMColParam = Session("MM_Username")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_user = '" +
    Replace(rsSession__MMColParam, "'", "''") + "'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0

    If NOT rsSession.EOF And NOT rsSession.BOF AND NOT
    IsNull(rsSession("p_ban")) Then
    user = rsSession("p_user")
    id = rsSession("p_id")
    response.redirect("restricted.asp?uz=") & user & ("&id=") & id
    end if

    elseIf (ucase(Request.Cookies("id"))<> "$") AND
    (ucase(Request.Cookies("access"))<> "") Then
    Dim user_id
    Dim user_pass
    user_id=Request.Cookies("id")
    user_pass=Request.Cookies("access")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_user = '" + Replace(user_id,
    "'", "''") + "' AND p_password = '" + Replace(user_pass, "'", "''") + "'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0

    If NOT rsSession.EOF And NOT rsSession.BOF AND NOT IsNull(rsSession("p_ban"))
    Then
    Session("MM_Username") = rsSession("p_user")

    set rsupp = Server.CreateObject("ADODB.Command")
    rsupp.ActiveConnection = MM_conn_STRING
    rsupp.CommandText = "UPDATE p_users SET p_expdate = Now()+365 WHERE p_user =
    '" + Replace(user_id, "'", "''") + "'"
    rsupp.CommandType = 1
    rsupp.CommandTimeout = 0
    rsupp.Prepared = true
    rsupp.Execute()
    set rsupp = nothing

    elseIf NOT rsSession.EOF And NOT rsSession.BOF AND NOT rsSession("p_ban") = ""
    Then
    user = rsSession("p_user")
    id = rsSession("p_id")
    response.redirect("restricted.asp?uz=") & user & ("&id=") & id
    end if
    else

    rsSession__MMColParam = Session("MM_Username")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_access = 'nothing'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0
    End If

    %><%
    '===============================================
    ' (C) 2004 Radiant Software, Inc. Version 2.4
    ' Email Contact: [email]Personals@TestPersonals.com[/email]
    ' Parts of this code were developed by Duware.com
    '===============================================
    ' - EDIT BELOW -
    '================================================= =======
    'The system should work right out of the box the way it
    'is setup here. Please keep in mind that this is a easy
    'install but not very secure. Anyone who knows the
    'location of your DB can download it and get the admin
    'password. It is a good idea to move the DB to a folder
    'that can not be accessed by the web or the IIS
    'anonymous user.
    '================================================= =======

    'MS Access Connection String
    'datasourcename="yourdsn"

    'MS Access Connection String
    datasourcename="Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    Server.MapPath("database/personals24.mdb")

    ' - DO NOT EDIT BELOW -

    if NOT request.cookies("rest") = "" then
    id = request.cookies("rest")
    response.redirect("restricted.asp?idd=") & id
    end if

    Response.Buffer = True
    Response.ExpiresAbsolute = Now() - 10
    Response.Expires = -1000
    Response.CacheControl = "no-cache"

    'Dim pathtodatabase
    Dim datasourcename
    Dim DBtype
    Dim cursortype
    Dim MM_conn_STRING
    Dim cmdTemp
    Dim rs_main
    Dim rs_main2
    Dim rsSession
    Dim rsSession_numRows
    Dim rsSession__MMColParam
    Dim rs125
    Dim rs125_numRows


    '-----------------------------------------------
    'DATABASE CONNECTION SETTINGS
    '-----------------------------------------------
    Set MM_conn_STRING = Server.CreateObject("ADODB.Connection")
    MM_conn_STRING.Open datasourcename
    Set cmdTemp = Server.CreateObject("ADODB.Command")
    Set rs_main = Server.CreateObject("ADODB.Recordset")
    Set rs_main2 = Server.CreateObject("ADODB.Recordset")

    If (Session("MM_Username") <> "") Then
    rsSession__MMColParam = Session("MM_Username")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_user = '" +
    Replace(rsSession__MMColParam, "'", "''") + "'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0

    If NOT rsSession.EOF And NOT rsSession.BOF AND NOT
    IsNull(rsSession("p_ban")) Then
    user = rsSession("p_user")
    id = rsSession("p_id")
    response.redirect("restricted.asp?uz=") & user & ("&id=") & id
    end if

    elseIf (ucase(Request.Cookies("id"))<> "$") AND
    (ucase(Request.Cookies("access"))<> "") Then
    Dim user_id
    Dim user_pass
    user_id=Request.Cookies("id")
    user_pass=Request.Cookies("access")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_user = '" + Replace(user_id,
    "'", "''") + "' AND p_password = '" + Replace(user_pass, "'", "''") + "'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0

    If NOT rsSession.EOF And NOT rsSession.BOF AND NOT IsNull(rsSession("p_ban"))
    Then
    Session("MM_Username") = rsSession("p_user")

    set rsupp = Server.CreateObject("ADODB.Command")
    rsupp.ActiveConnection = MM_conn_STRING
    rsupp.CommandText = "UPDATE p_users SET p_expdate = Now()+365 WHERE p_user =
    '" + Replace(user_id, "'", "''") + "'"
    rsupp.CommandType = 1
    rsupp.CommandTimeout = 0
    rsupp.Prepared = true
    rsupp.Execute()
    set rsupp = nothing

    elseIf NOT rsSession.EOF And NOT rsSession.BOF AND NOT rsSession("p_ban") = ""
    Then
    user = rsSession("p_user")
    id = rsSession("p_id")
    response.redirect("restricted.asp?uz=") & user & ("&id=") & id
    end if
    else

    rsSession__MMColParam = Session("MM_Username")
    set rsSession = Server.CreateObject("ADODB.Recordset")
    rsSession.ActiveConnection = MM_conn_STRING
    rsSession.Source = "SELECT * FROM users WHERE p_access = 'nothing'"
    rsSession.CursorType = 0
    rsSession.CursorLocation = 2
    rsSession.LockType = 3
    rsSession.Open()
    rsSession_numRows = 0
    End If

    %>

    Ken_iversen Guest

  5. #4

    Default Re: Virtual Path

    have you tried..?

    & Server.MapPath("jimglass/database/databasename.mdb")
    CarlGrint Guest

  6. #5

    Default Re: Virtual Path

    Hi, Carl Yes, I think I have tried every possible combination of the path :)
    Your suggestion takes the error to line 55 where is calls to 'open' the
    database Here is the message I get... Mate, thanks for your patience on this...
    Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC
    Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the
    path name is spelled correctly and that you are connected to the server on
    which the file resides. /man-ads/connection/connection.asp, line 55

    Ken_iversen Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139