[plain] view plain copy
Dim Conn
Set Conn=CreateObject("ADODB.Connection")
Const ConnectionString="DSN=test81;DATABASE=customerWD=hORT=3307;SERVER=192.168.1.81;UID=user"
'DSN 创建的数据源名称;DATABASE 数据库名称WD 数据库密码ORT 端口号;SERVER 数据库地址;UID 数据库用户名
Conn.Open ConnectionString
If Conn.State<>0 Then
Reporter.ReportEvent micPass,"testing","连接数据库成功"
else
Reporter.ReportEvent micFail,"testing","连接数据库失败"
End If