asp无法连接PHP的问题

criyced 2014-07-28 11:36:35
代码:
connstr = "driver={mysql odbc 3.51 driver};database=nhga;server=localhost;uid=nhgazx;password=abcdefghijklmn_1234"
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = server.CreateObject("ADODB.Recordset")
Response.write("a")
conn.Open connstr
Response.write("b")
rs.open "select * from user where username = '" & username & "' and password = '" & password & "'",conn
If Not rs.eof Then
Response.write("yes")
Else
Response.write("no")
End If
调试页面输出a,没有输出b,这说明无法连接数据库,请问各位大虾是什么问题,如何解决?
另外,为什么ASP有时候会报错,有时候不报错(比如:未结束的字符串常量就报错,数据库连接失败就不报错),就像是IIS没有开启调试一样,编码很不方便。
说明:操作系统win7,iis7,mysql5.6.10.1。
谢谢各位大虾。
...全文
106 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
悠闲的包子 2014-08-04
  • 打赏
  • 举报
回复
楼上有答案...
hookee 2014-07-29
  • 打赏
  • 举报
回复
用的是数据库连接串是3.5的,数据库是5.x的,版本不匹配,用5.x的驱动和连接串就可以了

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧