asp 连接 mysql数据库问题
系统环境:windows7 + asp + mysql5.0
已经安装了驱动mysql-connector-odbc-5.1.7-win32,在ODBC添加了系统DSN:testcgc,(但新增后无法删除和配置,单击“删除”或“配置”后会报:Invalid attribute string)
运行下面代码会报错:
strConnection = "dsn=testcgc;driver={myodbd driver};server=localhost;uid=root;pwd=135246;database=cgc"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection
strQuery = "select ygbh from ygda"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open strQuery,strConnection,2,1
response.write rs.recordcount
If Not rs.BOF Then
response.write " 空值 "
Else
response.write "有值"+rs("ygbh")
end if
rs.Close
adoDataConn.Close
Set adoDataConn = Nothing
错误如下:
-1An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.