locked
connection problem IIs ver6- asp.net-accsess2007 window8 RRS feed

  • Question

  • User1472047230 posted

     I write the following program authors.asp that connect to accsess data base(authors.accdb) and fetch a set of record in the table authors

    <%  ' create conn as adodb.connection and open it  

    dim strconn  

    dim conn  

    dim rs     strconn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\inetpub\wwwroot\Asp_Access_Tp\authors.accdb" & Server.MapPath("C:\inetpub\wwwroot")    

    set conn = server.createobject("adodb.connection")  conn.open strconn  sql = "select * from Authors"  set rs = conn.execute(sql) %>

    <html>

    <head><title></title> </head> <body>

    <table border="1">

    <%  

     do while not rs.eof   response.write "<tr>  <td><b>" & rs("Field1") & "</td>     <td>" & rs("Field2") & "</td>    </tr>"  rs.movenext  loop  

        conn.close  Set conn = nothing  set rs = nothing %>

    </table> </body> </html>

    when I  run this form using internet explorer(version 10.0.92) : http://localhost/Asp_Access_Tp/authors.asp 

    I have got the following error: The website cannot display the page

    I click on the more info link test I received:

       this error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying

    any help to solve this problem I appreciate it

     

    thank you

     

    Note : I try to run a test file asp(test.asp) to be sure if the configuration (IIs and  Asp)has  been well done. http://localhost/Asp_Access_Tp/test.asp 

    this file is well executed and gave the result "My first ASP script !"

    Sunday, November 30, 2014 4:02 AM

Answers