ASP读取SQL字段,总提示“类型不匹配”!!!急!!!
代码:
rs.open "select power from [user] where name='"&username&"' and valid=1",conn_system,1,1
if rs.recordcount<>0 then
session("power")=trim(rs("power")) <-----出错,提示类型不匹配
end if
power在SQL中定义为 CHAR或者VARCHAR,结果都一样,提示类型不匹配。
环境为:WIN2000+IIS5/WIN ME+PWS,SQL 2000