'格式化sql中的like字符串

asp函数

2008-10-20 17:02

function formatQueryStr(str) '格式化sql中的like字符串
dim nstr
nstr = str
nstr = replace(nstr,chr(0),"")
nstr = replace(nstr,"'","''")
nstr = replace(nstr,"[","[[]")
nstr = replace(nstr,"%","[%]")
formatQueryStr = nstr
end function