30-----悬赏分----语法错误 (操作符丢失) 在查询表达式--------30悬赏分

来源:百度知道 编辑:UC知道 时间:2024/05/21 14:12:52
<% option explicit %>
<%

Dim Connstr,sql,conn,rs
Dim username, realname, address, tel, email,usr_Level
ConnStr="Provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("accessDB/LearnASP.mdb")
Set conn=Server.CreateObject ("ADODB.Connection")
conn. ConnectionString=ConnStr
conn.open '直接打开数据库连接

email=request.form("ctxtemail")

sql=("select * from t_userInfo where tel="&email&"")

set rs=Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
%>
高手帮忙解决啊
我数据库中有email这项的啊
而且这列不是空的,里面有数据
高手帮忙帮我把代码写出来啊
上面的代码问题我的数据库老师帮我解决了
我在上面代码下面加上如下代码:
</table>
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td colspan="

sql="select * from t_userInfo where tel='"&email&"'"

sql=("select * from t_userInfo where tel="&email&"")
这句话的意思好像是找出电话号码等于电子邮件得啊,肯定没有符合条件的记录了,你要的是不是下面的啊:
sql=("select * from t_userInfo where tel="&tel&"")
当然了你的先取得tel的值tel=request("tel"),假定你传递tel的参数名是tel
建议你最好
写成

sql="select * from t_userinfo where tel='" & email & "'

sql=("select * from t_userInfo where tel="&email&"")
这句话的意思好像是找出电话号码等于电子邮件得啊,肯定没有符合条件的记录了,你要的是不是下面的啊:
sql=("select * from t_userInfo where tel="&tel&"")
当然了你的先取得tel的值tel=request("tel"),假定你传递tel的参数名是tel

好明显email是从表单传过来的,

你最好写成

sql="select * from t_userinfo where tel='" & email & "'"

sql="select * from t_userinfo where tel='" & email & "'"