把传递参数作为数据表中字段名的问题,麻烦高手帮忙看看
dim id1,id2
function tongji(id1,id2)
Set Rs = Server.CreateObject("Adodb.Recordset")
sql="select id from tb_vote where " & id1 & "=" & id2
Rs.Open sql,Conn,1,3
tongji=rsadd.recordcount
rs.close
end function
dim q11,q12,q13,q14
q1=tongji("t1",1)
q2=tongji("t2",2)
q3=tongji("t5",3)
q9=tongji("t9",4)
获取参数id1(数字型)且其值为id2的记录数,结果显示:
标准表达式中数据类型不匹配。
response.write 打印出SQL看不出有什么问题。数据库为ACCESS.请问是传递参数作为数据表字段名有误吗?什么原因,哪位高手麻烦帮助我看看。谢谢!祝各位新年快乐!