手机
当前位置:查字典教程网 >编程开发 >ASP教程 >把字符串转换成数据库SQL语句格式
把字符串转换成数据库SQL语句格式
摘要:复制代码代码如下:'把字符串转换成数据库SQL语句格式'------------------------------------------...

复制代码 代码如下:

'把字符串转换成数据库SQL语句格式

'-------------------------------------------------

FunctionAllStr2Database(str,strType)

DimstrTemp:strTemp=str

SelectCasestrType

Case""

Case"num"

strTemp=Clng(strTemp)

Case"string"'无Trim

strTemp=Replace(strTemp,"'","''")

Case"str_br"'无Trim,把回车转换为<br>,一般用于多行文本输入

strTemp=Replace(Replace(strTemp,"'","''"),VbCrlf,"<br>")

Case"str_trim"'Trim

strTemp=Replace(Trim(strTemp),"'","''")

Case"nums"

strTemp=Trim(strTemp)

strTemp=Replace(strTemp,")","")

strTemp=Replace(strTemp,"(","")

strTemp=Replace(strTemp,"'","")

strTemp=Replace(strTemp,";","")

strTemp=Replace(strTemp,"","")

strTemp=Replace(strTemp,"or","")

strTemp=Replace(strTemp,"and","")

strTemp=Replace(strTemp,"delete","")

strTemp=Replace(strTemp,"select","")

strTemp=Replace(strTemp,"exec","")

strTemp=Replace(strTemp,"update","")

strTemp=Replace(strTemp,"select","")

Case"strings"

CaseElse

EndSelect

AllStr2Database=strTemp

EndFunction

【把字符串转换成数据库SQL语句格式】相关文章:

字符批量替换程序asp服务器版

带数据库的ASP用户名密码登录验证代码

asp 字符串连接数据库方法

ASP开发中数据库文件调用的捷径

ASP整合一个SQL语句类

如何在数据库中用好Transaction?

asp数据库防下载处理

在ASP中连接MySQL数据库,最好的通过ODBC方法

ASP中将视频文件转换成.flv格式

ASP中数据库调用中常见错误的现象和解决

精品推荐
分类导航