ICnvt.exe OLEDB/IDataConvert Reads Oracle and MS DBs

ID: Q186384


The information in this article applies to:
  • Microsoft OLE DB Provider for ODBC, versions 1.0, 1.5, 2.0


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. Click the file name below to download the file:

ICNVT.EXE
Release Date: Jun-01-1998

For 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.asp
and then click How to use the Microsoft Download Center.

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 

Additional query words: kbDSupport kbdse kbADO kbDatabase kbOLEDB150

Keywords : kbfile
Version : WINDOWS:1.0,1.5,2.0
Platform : WINDOWS
Issue type :


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