nightheart
New Member
- Joined
- Feb 9, 2012
- Messages
- 10
Hi,
I'm running Windows 7 64 bit and Office 2010 32 bit. I'm trying to run an access query from excel using VBA but i got the above mentioned error at the highlighted step.
Would you please help me with that error. Thanks
I'm running Windows 7 64 bit and Office 2010 32 bit. I'm trying to run an access query from excel using VBA but i got the above mentioned error at the highlighted step.
Code:
Dim cn As ADODB.Connection
Dim strName As String
Dim strSQL As String
Dim strConnection As String
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
strName = Application.InputBox("Please enter the file location....", "File path")
With cn
.Provider = "Provider=Microsoft.ACE.OLEDB.12.0"
.ConnectionString = "Data Source=" & strName & " ;"
[COLOR=#ff0000].Open[/COLOR]
End With
Would you please help me with that error. Thanks