Hello, I am new to using VBA and am having an issue with connecting to my microsoft sql database.
I receive this error when setting my connection variable to a new ADODB connection:
run-time error -2147024770 (8007007e)
automation error
the specified module could not be found
my code is as follows:
Code:
Sub enterData()
Dim oCon As ADODB.Connection
Dim oRS As ADODB.Recordset
Set oCon = New ADODB.Connection
oCon.ConnectionString = "Server=servidor\celupal55;Database=celupal55;User ID=;Password=;Trusted_Connection=False;"
oCon.Open
Set oRS = New ADODB.Recordset
oRS.ActiveConnection = oCon
oRS.Source = "Select * From Table1"
oRS.Open
Range("A1").CopyFromRecordset oRS
oRS.Close
oCon.Close
If Not oRS Is Nothing Then Set oRS = Nothing
If Not oCon Is Nothing Then Set oCon = Nothing
End Sub
i do have microsoft activex data object library enabled in my reference list and have no addons installed
any ideas on what could be causing this?