VBScript编码模板(2003-11-14修改版) (转)

VBScript编码模板(2003-11-14修改版) (转)[@more@]

<!-- METADATA
TYPE="typelib"
FILE="C:Program FilesCommon FilesSystemADOmsado20.tlb"
--&gt
vbscript CodePage=936%>
Option Explicit
'=========================================================
'容错机制代码
'=========================================================
 DIM NDEbug_MSG
 NDEBUG_MSG=FALSE  'TRUE,FALSE

 IF NDEBUG_MSG = TRUE THEN
'出错过滤
 ON ERROR RESUME NEXT
 END IF

'=========================================================
'变量声明及定义区
'=========================================================

Dim ConnStr,oConn  'ADO连接变量
Dim sErrmsg  '错误变量

 

'=========================================================
' 事务定义区
'=========================================================

 


'=========================================================
'Func,Proc定义区
'=========================================================

'=========================================================
' 功能:打开数据源
' 参数:
' 返回值:
'=========================================================
Sub ConnectionDatabase
'sql数据库连接参数:数据库名、用户密码、用户名、连接名(本地用local,外地用IP)
 Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName
 SqlDatabaseName="xiaods"
 SqlPassword="!QAZXSW@"
 SqlUsername="xiaods"
 SqlLocalName="192.168.211.7"
 ConnStr = "Provider=Sqloledb; User ID=" & SqlUsername & "; Password=" & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data source=" & SqlLocalName & ";"
 'on error resume next
 Set oConn = Server.Createobject("ADODB.Connection")
 oConn.open ConnStr
 If Err Then
 err.Clear
 Set oConn = Nothing
 sErrmsg= "数据库连接出错,请检查连接字串。"
 mError(sErrmsg)
 End If
End Sub

'=========================================================
' 功能:关闭数据源
' 参数:
' 返回值:
'=========================================================
Sub CloseDatabase
oConn.close
Set oConn = Nothing
End Sub


'=========================================================
' 功能:输出错误信息
' 参数:sErrmsg
' 返回值:
'=========================================================
sub mError(sErrmsg)
'Response.Write sErrmsg&"please contact system administrator."
response.write " " & vbCrLf
response.write "

" & vbCrLf
response.write " 亚联游戏后台管理 系统" & vbCrLf
response.write " microsoft Visual Studio 6.0"">" & vbCrLf
response.write "" & vbCrLf
response.write " " & vbCrLf
response.write "" & vbCrLf
response.write " " & vbCrLf
response.write "
" & vbCrLf
response.write "" & vbCrLf
response.write " 
"&  sErrmsg&"
" & vbCrLf
response.write " 
您要浏览的页面有错误,请勿迟疑,立即与Mailto:webmaster@asiagame.com">mailto:webmaster@asiagame.com"">系统管理员联系。" & vbCrLf
response.write " 

If you have any problem, please " & vbCrLf
response.write "  don't hesitate to contact the Systems'>mailto:webmaster@asiagame.com"">Systems " & vbCrLf
response.write "  Administrator.

亚联游戏
" & vbCrLf
response.write "  Asiagame.com
" & vbCrLf
response.write "" & vbCrLf
response.write " 
"
response.write " " & vbCrLf
response.write " "
end sub
'ConnectionDatabase 'open Datesrc
%>
此为修改版

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752019/viewspace-962626/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752019/viewspace-962626/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值