Public Function myCnn() As Integer
On Error GoTo Err_11
Dim cnn As New ADODB.Connection
'Dim rst As New ADODB.Recordset
'Dim sql As String
cnn.Open "provider=Microsoft.Jet.OLEDB.4.0;" _
& " data source=C:\Documents and Settings\Administrator\My Documents\db1.mdb;" _
& " password=025124;"
MsgBox "OK"
myCnn = -1
Exit_11:
Exit Function
Err_11:
MsgBox "´íÎó£º(" & Err.Number & ")" & Err.Description
myCnn = 0
Resume Exit_11
End Function
错误:无法启动应用程序.工作组信息文件丢失,或是已被其它用户以独占方式打开