多乐彩十分开奖:难点与不同点,ASP链接MSSQL2005的链接字符串

北京快乐八软件 www.gcpng.com ASP链接MSSQL2005的链接字符串如下:

Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=master;Uid=xeonwell;Pwd=xxxx;

测试用例如下:(ASP链接MSSQL2005测试)

<%
Option Explicit
Dim conn,rs,sql
Set conn = CreateObject("ADODB.Connection")
Dim strConn 'MSSQL 2005 Connection String
strConn = "Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=master;Uid=xeonwell;Pwd=xxxx;"
conn.Open strConn
Set rs = conn.Execute("select * from spt_values")
Dim i,j
j = rs.fields.count-1
Response.Write("<table border=1>")
Response.Write("<tr>")
for i = 0 to j
Response.Write("<th>" & rs.fields(i).name & "</th>")
next
Response.Write("</tr>")

While Not rs.EOF
' Response.Write(rs.fields(0).Name & ": " & rs.Fields(0).Value & "<br />")
Response.Write("<tr>")
for i = 0 to j
?? Response.Write("<td>" & replaceNull(rs.fields(i).value) & "</td>")
next
Response.Write("</tr>")
rs.MoveNext()
Wend
Response.Write("</table>")
rs.Close()
Set rs = Nothing
conn.Close()
Set conn = Nothing

Function replaceNull(str)
replaceNull = str
If isNull(str) OR str = "" Then
?? replaceNull = "&nbsp;"
End If
End Function
%>

《难点与不同点,ASP链接MSSQL2005的链接字符串》有1个想法

发表评论

电子邮件地址不会被公开。