asp,Set conn = Server.CreateObject("ADODB.Connection"),conn.Open "Provider=SQLOLEDB;Data Source=服务器地址;Initial Catalog=数据库名;User ID=用户名;Password=密码",Set rs = Server.CreateObject("ADODB.Recordset"),rs.Open "SELECT * FROM 表名", conn,While Not rs.EOF, Response.Write(rs("字段名")), rs.MoveNext,Wend,rs.Close,conn.Close,Set rs = Nothing,Set conn = Nothing,
``,,这段代码展示了如何连接到一个SQL Server数据库,执行查询并读取数据。请根据你的实际情况替换数据库连接字符串和查询语句。