asp 格式化sql中的like字符串
(编辑:jimmy 日期: 2024/11/27 浏览:3 次 )
<%
'******************************
'函数:formatQueryStr(str)
'参数:str,SQL语句
'作者:阿里西西
'日期:2007/7/13
'描述:格式化sql中的like字符串
'示例:<%=formatQueryStr(str)%>
'******************************
function formatQueryStr(str)
dim nstr
nstr = str
nstr = replace(nstr,chr(0),"")
nstr = replace(nstr,"'","''")
nstr = replace(nstr,"[","[[]")
nstr = replace(nstr,"%","[%]")
formatQueryStr = nstr
end function
%>
'******************************
'函数:formatQueryStr(str)
'参数:str,SQL语句
'作者:阿里西西
'日期:2007/7/13
'描述:格式化sql中的like字符串
'示例:<%=formatQueryStr(str)%>
'******************************
function formatQueryStr(str)
dim nstr
nstr = str
nstr = replace(nstr,chr(0),"")
nstr = replace(nstr,"'","''")
nstr = replace(nstr,"[","[[]")
nstr = replace(nstr,"%","[%]")
formatQueryStr = nstr
end function
%>
下一篇:asp实现生成由数字,大写字母,小写字母指定位数的随机数