Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to connect to a database in asp

Status
Not open for further replies.

BunBo900

MIS
Dec 11, 2009
50
US
Hello:

I have windows 7 prof and windows server 2008. I have the database in the folder the way it is in the code.

I found this code on the internet and dropped in my server to test and it is not doing what it is supposed to be doing. What else I need to do in order to get this working.

I got error: HTTP 500 Internal Server Error

Thank you.

Code:
<html>
 <body>

 <%
 set conn=Server.CreateObject("ADODB.Connection")
 conn.Provider="Microsoft.Jet.OLEDB.4.0"
 conn.Open "c:/webdata/northwind.mdb"

 set rs = Server.CreateObject("ADODB.recordset")
 rs.Open "SELECT * FROM Customers", conn

 do until rs.EOF
   for each x in rs.Fields
     Response.Write(x.name)
     Response.Write(" = ")
     Response.Write(x.value & "<br>")
   next
   Response.Write("<br>")
   rs.MoveNext
 loop

 rs.close
 conn.close
 %>

 </body>
 </html>
 
HTTP 500 Internal Server Error is weri generic error to see what is going on in reallity
First at all disable "Show friandly HTTP error messages" in your IE in internat options/advanced
You may need to adjust iis settings to sow server side errors
 
This is the error:
ADODB.Connection error '800a0e7a'
Provider cannot be found. It may not be properly installed.
/adoConnection.asp, line 8

Since this is a newly built server 2008, I am guessing it needs to install a database driver?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top