ACCESS转换成sql 中 instr问题
来源:百度知道 编辑:UC知道 时间:2024/05/31 20:25:46
Set Rs=server.createobject("adodb.recordset")
sql="select * from lib where InStr("&server.HTMLEncode(fs)&",'"&words&"')<>0 order by "&howturn&" desc"
rs.open sql,conn,3,3
错误如下
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
'InStr' 不是可以识别的 函数名。
/chat/libfindok.asp,行 24
sql="select * from lib where InStr("&server.HTMLEncode(fs)&",'"&words&"')<>0 order by "&howturn&" desc"
rs.open sql,conn,3,3
错误如下
Microsoft OLE DB Provider for SQL Server 错误 '80040e14'
'InStr' 不是可以识别的 函数名。
/chat/libfindok.asp,行 24
SQL Server 不支持 InStr 函数 ...
可以用 LIKE 语句替代的 ...
比如改成这样 ...
sql="SELECT * FROM lib WHERE "&server.HTMLEncode(fs)&" LIKE '%"&words&"%' ORDER BY "&howturn&" DESC"
sql="select lib.* from lib,(select field from lib where "& server.HTMLEncode(fs) &" = '"& words &"') b
where field=b.field order by "& howturn &"
field 就是表的主键!~