晒晒我的收获600字初中:sql语句哪错了??

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/10 11:10:53
<!--#include file="connxxx.asp"-->
<%dim haoma,rsx,sqlx
haoma=cstr(replace(trim(request.QueryString("haoma")),"'",""))
set rsx =server.CreateObject("adodb.recordset")
sqlx="select * from yhdata where haoma='"&haoma&"'" 就是这一行
rsx.open sqlx,connxxx,1,1
%>怎么说我语句未结束。

sqlx="select * from yhdata where haoma='" & haoma & "'"

用&连接字符时一定要空格否则 &接着跟数字或者&H数字 等这样的有时会被认为是转义后的

sqlx="select * from yhdata where haoma='haoma'
sqlx="select * from yhdata where haoma='"&haoma&"'这样也可以
你后面多了一个双引号了!

sqlx="select * from yhdata where haoma='" & haoma & "'"