Professional Web Applications Themes

Error reading from Access Database - ASP Database

Hi Folks Actually I am new to ASP, I will be thankful so much if anyone could help I have an Access2000 Database, I have Listing.html that has links to several ASP Pages, I pass a variable to ASP, And according to variable value I open the database and get its value The problem is that sometimes it works fine and sometimes it doesn't here is the code <% DBFilePath= Server.MapPath("pse.mdb") 'the connection string to be passed to the Connection Object DBConnString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & DBFilePath & "" 'instanciate a connection oobject Set connObj = Server.CreateObject("ADODB.Connection") ...

  1. #1

    Default Error reading from Access Database

    Hi Folks

    Actually I am new to ASP, I will be thankful so much if anyone could help

    I have an Access2000 Database, I have Listing.html that has links to several
    ASP Pages, I pass a variable to ASP, And according to variable value I open
    the database and get its value

    The problem is that sometimes it works fine and sometimes it doesn't

    here is the code

    <%


    DBFilePath= Server.MapPath("pse.mdb")

    'the connection string to be passed to the Connection Object

    DBConnString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & DBFilePath
    & ""

    'instanciate a connection oobject

    Set connObj = Server.CreateObject("ADODB.Connection")

    'Open the connection

    connObj.open DBConnString

    %>


    ========== code at the end of asp
    </center></div>

    <%

    'free recordset object memory location and close database connection

    RS.Close()

    Set RS = Nothing


    connObj.close()

    set connObj = Nothing

    %>

    </body>

    mostly it gives an error Internal Error, and after several trying I found
    the error on this line connObj.open DBConnString, But the page works fine
    sometimes and doesn't on another tries

    Thank You
    Mohammed Dwaikat


    Mohammed AM Dwaikat Guest

  2. #2

    Default Re: Error reading from Access Database

    1. Change from that ODBC connection string to an OLEDB connection string.
    ([url]www.connectionstrings.com[/url])
    2. Turn off friendly errors: [url]http://www.aspfaq.com/show.asp?id=2109[/url]

    If you still get an error, you'll see what the actual error is then. Post
    that here if you can't figure out how to fix it.

    Ray at work

    "Mohammed AM Dwaikat" <dwaikatmaktoob.com> wrote in message
    news:OqOF5j2KEHA.2456TK2MSFTNGP12.phx.gbl...
    >
    > The problem is that sometimes it works fine and sometimes it doesn't
    >
    > here is the code
    >
    > <%
    >
    > DBConnString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    DBFilePath
    >
    > mostly it gives an error Internal Error

    Ray at Guest

  3. #3

    Default Re: Error reading from Access Database

    Highly appreciated for you, It works good, Thanks too much.


    Mohammed AM Dwaikat
    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
    message news:ubw78n6KEHA.3012tk2msftngp13.phx.gbl...
    > 1. Change from that ODBC connection string to an OLEDB connection string.
    > ([url]www.connectionstrings.com[/url])
    > 2. Turn off friendly errors: [url]http://www.aspfaq.com/show.asp?id=2109[/url]
    >
    > If you still get an error, you'll see what the actual error is then. Post
    > that here if you can't figure out how to fix it.
    >
    > Ray at work
    >
    > "Mohammed AM Dwaikat" <dwaikatmaktoob.com> wrote in message
    > news:OqOF5j2KEHA.2456TK2MSFTNGP12.phx.gbl...
    >
    > >
    > > The problem is that sometimes it works fine and sometimes it doesn't
    > >
    > > here is the code
    > >
    > > <%
    > >
    > > DBConnString = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
    > DBFilePath
    > >
    > > mostly it gives an error Internal Error
    >
    >

    Mohammed AM Dwaikat Guest

Similar Threads

  1. Replies: 0
    Last Post: September 2nd, 02:20 PM
  2. Replies: 3
    Last Post: August 26th, 10:02 AM
  3. Replies: 7
    Last Post: August 25th, 05:48 PM
  4. [PHP] Reading an MS Access Database file on *NIX platformusing PHP
    By Ernest E Vogelsinger in forum PHP Development
    Replies: 0
    Last Post: August 25th, 07:57 AM
  5. Error reading from Access
    By Alexander M. Polak in forum ASP Database
    Replies: 2
    Last Post: August 19th, 10:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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