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 strongm 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. 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>
 
The classic ASP forum would be more useful for you: forum333

Have you set up a website in IIS on the server? What precisely is not working (like, error messages)?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top