SAMPLE: ICnvt.exe OLEDB/IDataConvert Reads Oracle and MS DBs

ID: Q186384

The information in this article applies to:

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 Access and SQL Server, where IDataConvert is not necessary.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ ICnvt.exe (size: 51025 bytes) 


Release Date: Jun-01-1998

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE : How to Obtain Microsoft Support Files from Online Services

ICnvt.exe reads the oleDBtst table from Oracle, Microsoft Access, and Microsoft SQL Server. The 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 MS 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

Additional query words: kbDSupport kbdse kbADO kbDatabase kbOLEDB150
Version           : WINDOWS:1.0,1.5,2.0
Platform          : WINDOWS

Last Reviewed: September 30, 1998