PRB: Cannot Use /Zp Compiler Option With DB-Library

Last reviewed: April 25, 1997
Article ID: Q37667

The information in this article applies to:
  • Microsoft SQL Server Programmer's Toolkit, version 4.2

SYMPTOMS

DB-Library (DB-Lib) programs compiled with /Zp (pack structure members) can produce General Protection Faults (GP-Faults) and unpredictable results. The problem seems to be limited to DB-Lib macros such as dbcurrow(), dbfirstrow(), and dbrowtype().

CAUSE

DB-Lib has been compiled with default structure alignment. If the user program is compiled with an incompatible pack option, DB-Lib macros will be generated with incorrect offsets, resulting in unpredictable results.

WORKAROUND

If the user program must be compiled with /Zp, the problem can be circumvented by putting pragma statements around the include for "sqldb" to force word alignment offsets to be generated when DB-Lib macros reference that structure.


Additional query words: dblib
Keywords : kbprg SSrvDB_Lib
Version : 4.20
Platform : OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.