用ASP连接MYSQL 用ODBC的源连接 ,查询没问题可以读取到数据,但如果查询语句里有AND的话那就查询不到有内容呀 比如select * from admin where username='test' and
pwd='123'的话 就查询不到数据,这是什么问题??
dim myHost,myDB,myUID,myPWD
myHost = "localhost"
myDB = "test"
myUID = "root"
myPWD = "root"
sql="select * from admin where username='test' and pwd='123'"
strconnection="driver={mysql odbc 5.1 driver};server=" & myHost & ";database=" & myDB & ";user name=" & myUID & ";password=" & myPWD
set conn = server.createobject("adodb.connection")
conn.open strconnection
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
Response.write rs.recordcount
结果等于 -1 但用SQL语句直接在MYSQL里查询 就有数据呀。