合并两个conn.asp ASP 高手请进

来源:百度知道 编辑:UC知道 时间:2024/05/25 18:47:07
把下面一个conn.asp合并!!能运行加分!!
第一个:<%

Function SafeRequest(ParaName,ParaType)
Dim ParaValue
ParaValue=Request(ParaName)
If ParaType=1 then
If not isNumeric(ParaValue) then
Response.write "<center>参数" & ParaName & "必须为数字型,请正确操作!</center>"
Response.end
End if
Else
ParaValue=replace(ParaValue,"'","''")
End if
SafeRequest=ParaValue
End function

Function FormatSQL(strChar)
if IsNull(strChar) Or IsEmpty(strChar) then
FormatSQL=""
else
FormatSQL=replace(strChar,"'","’")
FormatSQL=replace(FormatSQL,"*","×")
FormatSQL=replace(FormatSQL,"?","?")
FormatSQL=replace(FormatSQL,"(","(")
FormatSQL=replace(FormatSQL,")",")")
FormatSQL=replace(FormatSQL,"<","<")
FormatSQL=

去论坛找个整合教程就可以了..

如果要同时使用两个数据库的话 你把第二个 变量改个名直接拷贝到第一个就行了。
dim dbconn,connstr,database,DBPath
set dbconn=server.CreateObject("adodb.connection")
DBPath = Server.MapPath("#$js.asp")
dbconn.open "provider=microsoft.jet.oledb.4.0; data source="&DBpath

function CloseDB

dbconn.Close
set dbconn=Nothing

End Function

如果是使用同一数据库的话,那共同第一个就行了!