Type Mismatch with ADODB.Recordset

  • Thread starter Thread starter Adam Quark
  • Start date Start date
A

Adam Quark

Guest
Good afternoon, all -

I'm having a problem with an Excel macro.


I'm taking it over from another employee who has left, so I'm trying to figure out how to make it work.

Basically, it runs a sql query to grab some data and then plugs that data into an Excel sheet.


However, in the section running the query, I'm getting a Type Mismatch error - oddly enough, the routine works fine on another computer.

The variable and connection throwing the error are defined so;


Dim iIPNewAdmRecs As Integer
Dim rsIPNewAdm As ADODB.Recordset

The error being thrown is on this line in the connection section;


iIPNewAdmRecs = rsIPNewAdm.RecordCount

So, I'm guessing that iIPNewAdmRecs should not be defined as an integer. But, from searches, I'm not sure what it should be. Nor can I figure out why it works on one computer - and has for months and months - but, not this new one. Both are using the same version of Excel. The only real difference I can see is that one where it works is Win7, the other Win10.

Can anyone give me a hand on this?

Thanx in advance for any assistance!

Continue reading...
 
Back
Top