The information in this article applies to:
SYMPTOMS
With #import, it is possible to generate classes that encapsulate the
typelib of database API's, such as ActiveX Data Objects (ADO), within a
windows application. For example:
When doing so, you may receive the following errors from the #import for ADO on the Recordset.EOF property:
CAUSE
Within an application that uses Stdio.h, Ios.h or Streamb.h
(including Afxwin.h), EOF has already been defined as a constant
(-1). The #import then attempts to define the EOF property for ADO's Recordset or RDO's Resultset objects, and generates the C2629/C2238 errors on the following line of generated code in the Msado10.tlh file:
This line is attempting to define a variable, but EOF has already defined it as -1. As a result, this line of code parses to:
This does not compile because -1 is not a valid variable name. RESOLUTION
To correct this, you can use the rename attribute of #import as follows:
Rename changes the name of any "EOF" string that #import finds in the specified typelib to a new value. Another fix is to undefine EOF before importing ADO follows:
STATUSThis behavior is by design. Additional query words:
Keywords : kbprg kbADO kbDatabase kbMDAC kbGrpMDAC |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |