aaronward
Board Regular
- Joined
- Aug 2, 2006
- Messages
- 165
I am attempting to simply connect to an external Access database and display some basic information. however my password for the connection does not seem to be working. Code breaks right at my 'conn.Open CNCT' line and suggests the following:
'Cannot start your application. The workgroup information file is missing or opened exclusively by another user'
I have triple checked that the database is not opened and i have no other connections to it.
any suggestions? Thanks!
'Cannot start your application. The workgroup information file is missing or opened exclusively by another user'
I have triple checked that the database is not opened and i have no other connections to it.
any suggestions? Thanks!
Code:
Private Sub ReadIn()
Dim rst As ADODB.Recordset
Dim conn As ADODB.Connection
Dim dbFullName As String, SRC As String, CNCT As String
Dim strSql As String, MArray
'db information
dbFullName = ThisWorkbook.Path & "\backend.mdb"
'open connection
Set conn = New ADODB.Connection
CNCT = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
dbFullName & "; User ID=admin; Password=test;"
conn.Open CNCT
strSql = "SELECT * FROM tblCPR"
rst.Open strSql, conn, adOpenKeyset, adLockOptimistic
MArray = rst.GetRows
MsgBox UBound(MArray(1)) & vbCr & UBound(MArray(2))
'clean up
Set rst = Nothing
conn.Close
Set conn = Nothing
End Sub