请问,这里是哪里除问题了,该怎么改?谢谢!
Private Sub InitConnectObject()
Dim objUtility As epUtility
Dim strCNStr As String
Dim strPath As String
On Error GoTo ErrorHandler
strPath = App.Path
If Right(strPath, 1) = "\" Then
strPath = Left(strPath, Len(strPath) - 1)
Else
End If
strCNStr = "Provider=Microsoft.Jet.OLEDB.3.51;Password="""";Persist Security Info=True;Data Source=" & strPath & "\Epinfo2.mdb"
Set gadoCN = New ADODB.Connection
gadoCN.ConnectionString = strCNStr
gadoCN.Open
gConnString = strCNStr
CommonExit:
If Not (objUtility Is Nothing) Then Set objUtility = Nothing
On Error GoTo 0
Exit Sub
ErrorHandler:
If Not (objUtility Is Nothing) Then Set objUtility = Nothing
Err.Raise Err.Number
End Sub
Private Sub InitConnectObject()
Dim objUtility As epUtility
Dim strCNStr As String
Dim strPath As String
On Error GoTo ErrorHandler
strPath = App.Path
If Right(strPath, 1) = "\" Then
strPath = Left(strPath, Len(strPath) - 1)
Else
End If
strCNStr = "Provider=Microsoft.Jet.OLEDB.3.51;Password="""";Persist Security Info=True;Data Source=" & strPath & "\Epinfo2.mdb"
Set gadoCN = New ADODB.Connection
gadoCN.ConnectionString = strCNStr
gadoCN.Open
gConnString = strCNStr
CommonExit:
If Not (objUtility Is Nothing) Then Set objUtility = Nothing
On Error GoTo 0
Exit Sub
ErrorHandler:
If Not (objUtility Is Nothing) Then Set objUtility = Nothing
Err.Raise Err.Number
End Sub
Dim objUtility As epUtility 这句产生错误了我引用自己写的一个类库,没有错程序从
On Error GoTo 0
Exit Sub
正常结束可能你对 epUtility 的引用有错误,具体要看你的错误提示了