ASP连接SQL Server数据库一直发生HTTP 500-内部服务器错误

2025-01-20 01:58:15
推荐回答(1个)
回答1:

set rs_sqlSelect = server.createObject("adodb.recordset")
str_dataConn = "driver={SQL Server};server=localhost;uid=jyrevhs;pwd=1257539742807585;database=dobsta_Data"
str_sqlSelect = "select * from dob where sname = 'admin'"
rs_sqlSelect.open str_sqlSelect, str_dataConn, 1, 1

--------------------------------------------------
改成
--------------------------------------------------

set str_dataConn = server.createObject("adodb.connection")
set rs_sqlSelect = server.createObject("adodb.recordset")
str_dataConn.open "driver={SQL Server};server=localhost;uid=jyrevhs;pwd=1257539742807585;database=dobsta_Data"
str_sqlSelect = "select * from dob where sname = 'admin'"
rs_sqlSelect.open str_sqlSelect, str_dataConn, 1, 1

------------------------------

把internet选项--高级--显示友好的url错误 前面的勾勾去掉, 然后刷新页面, 把具体的错误贴出来

-------------------------------

server=localhost

改成

server=(local)