rootdown42
Board Regular
- Joined
- Jun 8, 2005
- Messages
- 93
I am on my first attempt to use vba to open an Access database from an Excel file and write the data in the Excel file to the database. Not surprisingly I've run into difficulty.
I'm using ADO to perform the commands. The code gives me "run-time error -2147217843 (80040e4d) Authentication failed" when I get to the last line in the code below. I don't understand how there is an authentication error when I have absolutely no protection on this database at all.
Can someone tell me what the problem is? Any help is appreciated.
I'm using ADO to perform the commands. The code gives me "run-time error -2147217843 (80040e4d) Authentication failed" when I get to the last line in the code below. I don't understand how there is an authentication error when I have absolutely no protection on this database at all.
Code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim intFiscYr(1 To 7) As Integer ' values for fiscal year
Dim intResponse As Integer
Dim myFlag As Boolean
myFlag = False
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"\\Mke01sfile01\Data\960\Systems and Applications\Forecasting\Rebate-Lapsing Data\" & _
"Consumer Rebate Database\Consumer Rebate Database.mdb;"
Can someone tell me what the problem is? Any help is appreciated.