我想獲得一個paramterised查詢工作在asp經典。讚賞 這裏任何幫助是錯誤參數化查詢asp經典缺少操作數錯誤
的Microsoft OLE DB提供程序的Visual FoxPro錯誤 '80040E14' 缺少操作數。 /portal/jobportal/getaddress1.asp,線141
function paramQuery()
code = ucase(request.querystring("code"))
stype = request.querystring("type")
cAddressType = request.querystring("caddresstype")
Set rs = Server.CreateObject("ADODB.recordset")
Set cmd = server.CreateObject("ADODB.Command")
If IsObject(Session("portal_conn")) Then
Set conn = Session("portal_conn")
Else
Set conn = Server.CreateObject("ADODB.Connection")
cConnString = "Provider=vfpoledb;Data Source="+session("portaldata")+"portal.dbc"
conn.open cConnString,"",""
Set Session("portal_conn") = conn
end if
cmd.ActiveConnection = conn
cmd.Prepared = true
cmd.CommandType = 1
cmd.CommandText = "SELECT * from uaddress where userid = "+cstr(session("userid"))+" and upper(name) like ? + % "+" and type = '"+ trim(cAddresstype)+"' order by add1"
set param1 = cmd.CreateParameter("@name",200,2,40)
cmd.Parameters.append param1
cmd.Parameters("@name") = code
cmd.Execute() <-- missing operand error
rs.Open cmd
end function
這是一個FoxPro特定的東西嗎?我以前使用過其他數據庫的'LIKE'子句的參數。 –
@Cheran我很久以前就讀過一些東西,它堅持了 - 我的不好。將相應地更新我的帖子。 –