当前位置:首页 > ASP教程 > ASP其他

asp 格式化sql中的like字符串

<%
'******************************
'函数: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
%>
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!