Knowledge Base

ICnvt.exe OLEDB/IDataConvert Reads Oracle and MS DBs

Article ID: 186384

Article Last Modified on 8/5/2004


APPLIES TO


This article was previously published under Q186384

SUMMARY

ICnvt.exe is a sample that reads a table from Oracle, Microsoft Access, and Microsoft SQL Server. The OLE DB provider for ODBC returns integer (numeric) data from Oracle in a DB_NUMERIC struct. To convert the DB_NUMERIC to a Visual C++ long, you must use the IDataConvert interface. ICnvt.exe demonstrates how to use the IDataConvert interface when reading an Oracle table. The program also reads the same table from Microsoft Access and SQL Server, where IDataConvert is not necessary.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: Jun-01-1998

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Using the Sample File

ICnvt.exe reads the oleDBtst table from Oracle, Microsoft Access, and Microsoft SQL Server. The Microsoft Access file "oleDBtst.mdb" (included) uses the DSN "oleDBtst" with the sample program. You will need to create the oleDBtst table on Microsoft SQL Server and Oracle.

The Microsoft SQL Server Script to create table oleDBtst:
   CREATE TABLE oleDBtst (
   autoIndx int IDENTITY (1, 1) NOT NULL ,
   lname char (12) NULL ,
   fname char (12) NULL ,
   height float NULL ,
   weight float NULL
   )

     // Insert some Test data
     insert into oleDBtst (lname,fname,height,weight) Values (
     'Reubin','billy',44,251)
     insert into oleDBtst ( lname,fname,height,weight) Values (
     'Mama','Joe',92,154)
     insert into oleDBtst ( lname,fname,height,weight) Values (
     'Klifton','billy',59,354)
Oracle:
   create table oleDBtst ( autoIndx number primary key, lname
   varchar2(12),fname  varchar2(12),height float, weight float);

       SQL> insert into oleDBtst ( lname,fname,height,weight) Values
    ('Klifton','billy',59,354);
To compile the program for Oracle, uncomment the following line from the top of the page:
   //#define xORACLE
				
(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Rick Anderson, Microsoft Corporation.

Additional query words: ICNVT kbdse

Keywords: kbdownload kbdatabase kbfile KB186384