Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/37667

From BetaArchive Wiki

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

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 : WINDOWS:4.2
Platform : WINDOWS
Issue type :


Last Reviewed: March 6, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.