-4

This question has been asked several times ( SO Question), One solution comes from here incl. the demo code Solution from WORDPRESS

ExportRecordsetToMSExcel('D:\x.xls', ADOTable1.Recordset );

If I try to compile this code I get this error message :

[DCC Fehler]   E2010 Inkompatible Typen: 'ADODB_TLB._Recordset' und 'Winapi.ADOInt._Recordset'

What is the reason why I can not compile this code, how to fix the data mismatch indicated by the compiler error message ?

Community
  • 1
  • 1
user1769184
  • 1,571
  • 1
  • 19
  • 44

1 Answers1

4

It looks like a simple type resolution issue. _Recordset type is declared in both ADODB_TLB and Winapi.ADOInt units.

Most probably you don't need ADODB_TLB so check your uses clauses and remove or comment it out.

In case you need to use both units for some reason, try listing ADODB_TLB before Winapi.ADOInt. (This could help as the compiler will take the most recent one when resolving unqualified types.)

What definitely works (but might take more effort) is to fully qualify the conflicting types to remove ambiguity, e.g. Winapi.ADOInt._Recordset.

Ondrej Kelle
  • 36,941
  • 2
  • 65
  • 128