Database invalid path error msg

Discussion in 'Classic ASP' started by Chaps, Feb 23, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Periodically when a users accesses one of my asp pages they get the following error

    We're sorry, but An error occurred during processing.
    Report for: Error opening gallery database connection

    ADO Reports these Database Error(s) executing:

    Err# : -2147467259 Description: 'E:\web\domain\htdocs\forum\_database\gallery.mdb' 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.

    I'm getting the error every once in a while especially when I make changes to the database. The path the error gives doesn't make since because the database is in the _database directory off of the root not in my forum directory. It doesn't happen all the time but it is rather anoying any suggestions???
     
  2. Just checked and I have the error again this time I have done no changes at all and the error is.

    Err# : -2147467259 Description: 'E:\web\domain\htdocs\calendar\_database\gallery.mdb' 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.

    Notice the path changed to Calendar instead of forum it would appear to me that whatever path the user was last at before clicking the link to this asp page is the path that gets messed up. Any suggestions????
     
  3. could you give us some code of how you set up your connections ?
    do you use sessions, application variables, server.mappath, ...

    Now it is very hard to guess.



    --
    Steurm
    www.steurm.net/steurm
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Does this happen when you are overwriting the DB? This error will happen when someone hit your site when you are overwriting your DB. I suggest you upload the DB using a different name, delete the old DB, and rename the new DB to the original name.


    quote:Originally posted by Chaps

    Just checked and I have the error again this time I have done no changes at all and the error is.

    Err# : -2147467259 Description: 'E:\web\domain\htdocs\calendar\_database\gallery.mdb' 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.

    Notice the path changed to Calendar instead of forum it would appear to me that whatever path the user was last at before clicking the link to this asp page is the path that gets messed up. Any suggestions????
    </blockquote id="quote"></font id="quote">
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    Chap.

    To be honest, i am a big opponent of using MS Access in web application. MS Access was designed to be used as a desktop database (ie. single user connecting to it) rather than a database server where multiple users connecting to it.

    In my many years in the industry, I have seen so many unexplained problems with MS Access. These problems are usually sporadic and is very hard to debug. 1 thing i know for sure that will mess up Access is when you have high load and bad programming.

    High load : many concurrent connections to the DB
    Bad programming: i have seen people open 20 connections to the same database in a single asp page. 3 concurrent hit to the page will kill the application. Or leaving DB connection open.

    With that said, i think you should consider moving to MS SQL. Most people will never go back to Access once they used SQL.


    quote:Originally posted by Chaps

    Bruce,

    Yes it does happen when I make a manual change to the database and then re-upload it using FTP. However I haven't made a change in weeks and this problem still comes up periodically. Thanks for the advice about the upload/rename stuff I will do just that.

    Chaps
    </blockquote id="quote"></font id="quote">
     
  6. <%@ enablesessionstate = false Language=VBScript %>
    <% option explicit
    Response.Buffer = true

    %>
    <!-- #include file="../include/errorado.inc" -->
    <html>

    <head>
    <title>Domainname</title>

    <link type="text/css" rel="stylesheet" href="../styles/main.css">

    </head>


    <% InitPage %>

    <table border="0" cellpadding="0" cellspacing="0" width="750"> <!-- this table constrains the size of the entire page to 800 pixels wide -->
    <tr>
    <td valign="middle" align="center" width="100"></td> <!-- this column makes space for the menu -->
    <td valign="middle" align="center" width="50"></td> <!-- this column makes space between the menu and page content -->
    <td valign="middle" align="center" width="600"> <!-- this column holds the header graphic -->
    <img border="0" src="../images/newlogosmall1.jpg" width="375" height="83">
    </td>
    </tr>
    <tr>
    <td valign="middle" align="center" width="100">
    <!-- insert the content page menu here -->
    <!--#include file="../include/content_menu.inc" -->
    </td>
    <td width="50"></td>
    <td valign="middle" align="center" width="600">
    <!-- put all your page content in this table column -->
    <font size=+2>
    Layouts
    </font>


    Click on an image to see a larger version in a new window.



    Want to share your layout? Upload it <a href="../content/piclogin.asp">here</a>




    <% getimages %>

    </td>
    </tr>
    </table>

    <!--include file="../include/footer.asp"-->



    </body>
    </html>

    <%

    sub Initpage

    end sub

    sub GetImages
    on error resume next

    dim objconn, objrst
    dim strsql
    dim intColCount
    dim strTemp

    set objconn = server.CreateObject("adodb.connection")

    objconn.Mode = 3
    objconn.Open application("gallery_conn_str")

    if err then
    Response.Write erroradoreport("Error opening gallery database connection",objconn,strsql,"
    ")
    objconn.Close
    set objconn = nothing
    Response.End
    end if

    strsql = "select * from images;"

    set objrst = server.CreateObject("adodb.recordset")

    objrst.Open strsql, objconn,,,1

    if err then
    Response.Write erroradoreport("Error retrieving layouts from database",objconn,strsql,"
    ")
    objconn.Close
    set objconn = nothing
    objrst.Close
    set objrst = nothing
    Response.End
    end if

    'loop through the recordset, displaying the images

    if objrst.EOF then
    Response.Write "There are no images in the database to display!"
    else
    'prepare the beginning table tags
    Response.Write "<table border=0>"
    end if


    do until objrst.EOF

    Response.Write "<tr>"

    intcolcount = 1

    do until intcolcount > 3

    Response.Write "<td valign=middle align=center>"
    'strTemp = "<a href=viewlayout.asp?id=" & cstr(objrst.Fields("id").value) & """ target=_top><img src=""" & objrst.Fields("filepath").Value & "/" & objrst.Fields("thumbnail").Value & """ border=0>
    " & objrst.Fields("title").Value & " - " & objrst.Fields("description").Value & "</a>"
    'Response.Write "<a href=viewlayout.asp?id=" & cstr(objrst.Fields("id").value) & " target=_top><img src=""" & objrst.Fields("filepath").Value & "/" & objrst.Fields("thumb1").Value & """ border=0>
    " & objrst.Fields("title").Value & "</a>"

    ' strtemp = "<a href=""viewlayout.asp?id=""" & cstr(objrst.fields("id").value) & " target=""_blank""><img src=""" & objrst.fields("filepath").value & "/" & objrst.fields("thumb1").value & """ border=0>
    " & objrst.fields("title").value & "</a>"


    Response.Write "<a href=""viewlayout.asp?id=" & cstr(objrst.fields("id").value) & """ target=""_blank""><img src=""" & objrst.fields("filepath").value & "/" & objrst.fields("thumb1").value & """ border=0>
    " & objrst.fields("title").value & "</a>"


    Response.Write "</td>"

    objrst.MoveNext

    if not objrst.EOF then
    intcolcount = intcolcount + 1

    if intcolcount > 3 then
    Response.Write "</tr>"
    end if
    else
    intcolcount = 4
    Response.Write "</tr>"
    end if

    loop

    loop

    Response.Write "</table>"

    objrst.Close
    set objrst = nothing
    objconn.Close
    set objconn = nothing

    on error goto 0





    end sub

    %>

    ****Global.asa is as follows****

    <SCRIPT LANGUAGE=VBScript RUNAT=Server>

    sub application_onstart

    if instr(1,server.MapPath("."),"root") then
    application("siteurl") = "http://www.domainname.com/"
    else
    application("siteurl") = "/domainname/"
    end if

    application("maillist_conn_str") = server.MapPath("_database/maillist.mdb")
    application("gallery_conn_str") = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.MapPath("_database/gallery.mdb")

    end sub

    </SCRIPT>
    I'm thinking of hardcoding the database connection instead of using the global.asa????

    Thanks
    Chaps
     
  7. Bruce,

    Yes it does happen when I make a manual change to the database and then re-upload it using FTP. However I haven't made a change in weeks and this problem still comes up periodically. Thanks for the advice about the upload/rename stuff I will do just that.

    Chaps
     
  8. I will look into moving to SQL. I'm in a huge learning phase and I knew access once I get caught up with the projects I'm going to do several things different since I have learned so much in a very almost too short of a time period. Thanks for the suggestion.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page