我输入信息的时候总是说“Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配”
能不能帮我看下我的代码有没有问题,谢谢。
<%
dim user_id_name,user_password,user_name,user_sex,user_age,user_hospital_name,user_hospital_num
user_id_name=replace(trim(request("user_id_name")),"'","")
user_password=replace(trim(request("user_password")),"'","")
user_name=replace(trim(request("user_name")),"'","")
user_sex=replace(trim(request("user_sex")),"'","")
user_age=replace(trim(request("user_age")),"'","")
user_hospital_name=replace(trim(request("user_hospital_name")),"'","")
user_hospital_num=replace(trim(request("user_hospital_num")),"'","")
Set Conn=Server.CreateObject("ADODB.Connection")
connstr="DBQ="+server.mappath("data/data.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
Conn.Open connstr
%>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from user where user_id_name='"&request("user_id_name")&"'"
rs.open sql,conn,1,1
if rs.recordcount>0 then
response.write"<Script Language='JavaScript'> alert('对不起,您输入的用户名已存在,请返回重新输入!');history.back(-1);</script>"
response.end
end if
%>
<%
user_id_name=replace(trim(request("user_id_name")),"'","")
user_password=replace(trim(request("user_password")),"'","")
user_name=replace(trim(request("user_name")),"'","")
user_sex=replace(trim(request("user_sex")),"'","")
user_age=replace(trim(request("user_age")),"'","")
user_hospital_name=replace(trim(request("user_hospital_name")),"'","")
user_hospital_num=replace(trim(request("user_hospital_num")),"'","")
sql1="insert into [user] (user_id_name,user_password,user_name,user_sex,user_age,user_hospital_name,user_hospital_num) values ('"&user_id_name&"','"&user_password&"','"&user_name&"','"&user_sex&"','"&user_age&"','"&user_hospital_name&"','"&user_hospital_num&"')"
conn.execute sql1
response.write "注册成功!"
response.redirect "login.asp"
conn.close
set conn=nothing
%>
[此贴子已经被作者于2007-11-9 10:13:05编辑过]