我的安装了一个Microsoft SQL Server 2008 R2企业版,目前asp无法读取数据库,有高手没?
DimconnSetconn=Server.CreateObject("ADODB.Connection")conn.Open"driver={SQLServer};se...
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={SQL Server};server=XXK\ymxxk;uid=sa;pwd=hwf123456;database=ymxxk"
'conn.Open "driver={SQL Server};server=10.110.13.85;uid=sa;pwd=hwf123456;database=ymxxk"
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from 单位 where 单位名称='常村煤矿'"
rs.open sqlstr,conn,1,3
Response.write("连接2:"&conn.ConnectionString&"<br/> spt_values行数:"&rs.recordcount&"<br/>")
do While not rs.eof
Response.write(rs(0)&","&rs(1)&"<br/>")
rs.MoveNext
Loop
rs.close()
把上面的server=xxk\ymxxk换成10.110.13.85就出不来了是什么原因? 展开
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={SQL Server};server=XXK\ymxxk;uid=sa;pwd=hwf123456;database=ymxxk"
'conn.Open "driver={SQL Server};server=10.110.13.85;uid=sa;pwd=hwf123456;database=ymxxk"
set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from 单位 where 单位名称='常村煤矿'"
rs.open sqlstr,conn,1,3
Response.write("连接2:"&conn.ConnectionString&"<br/> spt_values行数:"&rs.recordcount&"<br/>")
do While not rs.eof
Response.write(rs(0)&","&rs(1)&"<br/>")
rs.MoveNext
Loop
rs.close()
把上面的server=xxk\ymxxk换成10.110.13.85就出不来了是什么原因? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询