Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO error

Status
Not open for further replies.

Beesknees

Programmer
Feb 27, 2001
95
GB
When creating a recordset using ADO I keep getting an error 'Type mismatch' when running the line 'Set rsTransactions = comOTTransactions.Execute'
I've used ADO a lot and never come across this before, I've tried re-registering the MDAC type library but no joy.
Any ideas?
 
Hi

I'm not sure but it could be because you have alternate references that visual basic is picking up that has higher priority than the ADODB.RecordSet object

Try explicitly referencing the ADODB.RecordSet
Eg

Dim rs As ADODB.RecordSet
Set rs = CreateObject("ADODB.RecordSet")

Also,

Make sure the comOTTransactions.Execute method returns type
ADODB.RecordSet
If you don't know how to check this, place your cursor over the .Execute part and press Shift+F2.
This will bring up the Object Explorer & you can view the return type there.

If you get a error similar to 'Cannot jump to Execute because it's hidden then Right Click on the Object Explorer (anywhere on the Object Explorer will do) & select Show hidden members sub-menu from the popup menu.

 
Luckily (for me) the solution was less complex than that.
I reisntalled the MDAC files and it worked fine, must've written over them with some installation or other....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top