TYPE=”typelib”
FILE=”C:\Program Files\Common Files\System\ADO\msado20.tlb”
–>
<%
‘加入的文件
%>
<%
‘代码版权说明:
‘=========================================================
‘ File: 文件名.asp
‘ Version:1.0
‘ Date:
‘ Script Written by Tommy xiao
‘ Description:
‘
‘ Revision:
‘ Date:
‘ Author:
‘ Description:
‘=========================================================
‘ Copyright (C) 2003 Asiagame.Com. All rights reserved.
‘ Web: http://www.advancededu.c来源gaodai#ma#com搞*!代#%^码网om
‘ Need help? Contact: [email protected]
‘=========================================================
%>
<%
‘容错机制代码
‘——————————–
DIM NDEBUG_MSG
NDEBUG_MSG=FALSE
IF NDEBUG_MSG = TRUE THEN
‘出错过滤
ON ERROR RESUME NEXT
END IF
‘变量声明及定义区
‘Boolean error variant
Dim BlnFounderr,sErrmsg
BlnFounderr = FALSE
‘触发错误信息
‘sErrmsg=sErrmsg+”
“+”
‘BlnFounderr = TRUE
Dim oConn,oRs,sSQL ‘ADO objects
‘Set oConn = Server.CreateObject (“ADODB.Connection”)
‘ oConn.Open Application(“connStr”)
‘事务定义区
‘输出错误
If BlnFounderr = TRUE Then
mError()
End If
‘Func,Proc定义区
Function DealInput(exp1)
dim exp2 ‘Filter input for invalid characters
exp2=Replace(exp1,”<","<")
exp2=Replace(exp2,”>”,”>”)
exp2=Replace(exp2,”‘”,”””)
exp2=Replace(exp2,”&”,”&”)
DealInput=exp2
End Function
Function CloseDatabase ‘ CloseDatabase
oConn.close
Set oConn = Nothing
End Function
sub mError()
‘Response.Write sErrmsg&”please contact system administrator.”
response.write ” ” & vbCrLf
response.write ” ” & vbCrLf
response.write ”
response.write ” ” & vbCrLf
response.write ” ” & vbCrLf
response.write ” ” & vbCrLf
response.write ” ” & vbCrLf
response.write “” & vbCrLf
response.write ” ” & vbCrLf
response.write “” & vbCrLf
response.write ” ” & vbCrLf
response.write ”
” & vbCrLf response.write ”
|
” & vbCrLf
response.write ” ” & vbCrLf
response.write ” ”
end sub
%>
以上就是ASP、vbscript编码模板的详细内容,更多请关注gaodaima搞代码网其它相关文章!