The information in this article applies to:
SUMMARY
The Vcspnp.exe sample demonstrates correct handling of SQL NULL with Microsoft ADO using #import and Visual C++. MORE INFORMATIONThe following file is available for download from the Microsoft
Download Center. Click the file name below to download the file: Vcspnp.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center.
To send a SQL NULL parameter, create a _variant_t and then change the type to VT_NULL. The following code snippet shows this:
To read a field value that could be SQL NULL, you must test it for VT_NULL. The following code snippet demonstrates this:
REFERENCESFor additional information, please see the following articles in the Microsoft Knowledge Base: Q182389 FILE: Adovcbm.exe ADO 1.5 with #import and Getrows/Bookmarks Q184968 FILE: Adovcsp.exe Demonstrates Using Stored Procedures with ADO Q181733 FILE: Adovcbtd.exe #import Using UpdateBatch and CancelBatch Q220152 FILE: Sample: ADOVC1 Simple ADO/VC++ Application Q200122 SAMPLE: ATL2ADO returns disconnected recordset from COM to VB(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Rick Anderson, Microsoft Corporation. Additional query words:
Keywords : kbfile kbsample kbADO kbADO200 kbDatabase kbVC kbVC600 kbGrpVCDB kbGrpMDAC |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |