Error code in excel macro

H

Herb B

Below code runs fine on about 10 laptops with windows xp pro sp2.
Code is snippet from an excel vba macro.

However, on just 1 laptop, we get following error message:

Error # -2147221164 was generated by Provider Class not registered

Error occurs on this line below:
adoRS1.Open strSQL1, adoCN, adOpenDynamic, adLockOptimistic

We've verified mdac is at 2.8 and all xp and office 2002 service packs
applied.
Not sure how to debug or figure out. Using oledb, so odbc trace didnt work.

Any ideas?
TIA.

======================================
Set adoCN = New ADODB.Connection

' ADO Connections for SQL Server

With adoCN
.Open "Provider=SQLOLEDB;" & _
"Data Source=xxx.xx.x.xx;" & _ ' IP address has
been changed from working IP.....
"Initial Catalog=dbFP_Summary;" & _
"User Id=fpsummaryrw;" & _
"Password=fpsummaryrw"
On Error GoTo ErrorHandler
End With

strSQL1 = "Select * From tbl_ESM_estimates Where " & _
"CR_Number = '" & strCRNum & "' And " & _
"System_ID = '" & strSystemID & "' And " & _
"TNC_Level = '" & strTNCLevel & "' "

strAudit = "tbl_ESM_estimates_Audit"

Set adoRS1 = New ADODB.Recordset
Set adoRS2 = New ADODB.Recordset

adoRS1.Open strSQL1, adoCN, adOpenDynamic, adLockOptimistic
adoRS2.Open strAudit, adoCN, adOpenDynamic, adLockOptimistic

==========================================
 
C

Cindy Meister

Then I suggest you ask in the Data.ADO group. The error appeared to have
something to do with ADO, not Excel/Office. Possibly, someone in that group
has experience with it.
 
H

Herb B

Thanks , Cindy.

Cindy Meister said:
Then I suggest you ask in the Data.ADO group. The error appeared to have
something to do with ADO, not Excel/Office. Possibly, someone in that
group
has experience with it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top