Thursday, July 30, 2009

How would I go about creating a webpage that connects to a database using ASP?

sorry for lack of details but i am not really sure what it is supposed to do

How would I go about creating a webpage that connects to a database using ASP?
put the following inside of a plain text file named default.asp and upload it to a web server that is running IIS.





%26lt;%





dim con, rec


set con = server.createobject ("adodb.connection")


set rec = server.createobject("adodb.recordset")


con.connectionstring = "provider=sqloledb; uid=sa; pwd=sa; database=northwind;"


con.open


rec.open "select contactname,phone from customers", con





do until rec.eof


response.write rec("contactname") %26amp; " " %26amp; rec("phone") %26amp; "%26lt;br%26gt;"


rec.movenext


loop





%%26gt;
Reply:http://www.4guysfromrolla.com/


No comments:

Post a Comment