DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
SQL Server ASP Database Test
// basic sql server database asp code test
<%
str_ConnectionString = "Provider=SQLOLEDB;Data Source=servername;Initial Catalog=database;User Id=user;Password=pwd;"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open str_ConnectionString
set rs = Server.CreateObject("ADODB.recordset")
strSQL="select * from tablename"
rs.Open strSQL, oConn
do until rs.EOF
for each x in rs.Fields
response.write x.value & "|"
next
rs.MoveNext
response.write "<br>"
loop
rs.Close
oConn.Close
set oConn = Nothing
%>




