function nohtml(str)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(<.+?>)"
str=re.replace(str,"")
nohtml=str
set re=nothing
end function
代码是在VC++里面:[cpp] view plaincopyprint?
CString sql, str
sql.Format(_T("SELECT * FROM tbPatient WHERE admitDate BETWEEN CDate('%s %s') AND CDate('%s %s')"),
dtStartDate.Format(_T("%x")), dtStartTime.Format(_T("%X")),
dtEndDate.Format(_T("%x")), dtEndTime.Format(_T("%X")))
//字段合并的模糊查询 MYSQL concat(email,address) like 'like%df%'
if(!strKeyWord.IsEmpty())
{
//SQL Server中IsNull(expression, replace)有替换功能,
//Access需要结合IsNull ( expression ), iif (condition, value_if_true, value_if_false )函数
//str.Format(_T(" AND IsNull(name, ' ') &IsNull(Empid, ' ') LIKE '%%%s%%'"),
// strKeyWord.GetBuffer(0))
str.Format(_T(" AND iif(IsNull(name),' ',name) &iif(IsNull(Empid),' ',Empid) LIKE '%%%s%%'"),
strKeyWord.GetBuffer(0))
sql += str
}
TRACE1("%s\n", sql)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)