Public Function OpenOracle(strServerName As String, strUserName As String, strUserPwd As String) As Boolean
On Error GoTo errH
OpenOracle = False
With gcnOracle
If .State = adStateOpen Then .Close
.Provider = "MSDataShape"
.Open "Driver={Microsoft ODBC for Oracle};Server=" & strServerName, strUserName, strUserPwd
If Err <> 0 Then
MsgBox "连接失败!(请确保用户名与密码输入无误)", vbInformation, gstrSysName
Exit Function
End If
End With
OpenOracle = True