Click to See Complete Forum and Search --> : OLE DB/ADO help needed plz.
odeveloper
February 19th, 2003, 11:10 PM
Hi all!
I m new to this group.
I hv started learning Visual C++ Database programing
database is Oracle 7.3.4 and i want help (step by step)
creating OLE DB/ADO app. with a table contained three
data types (int, char, date) anybody plz can help me??
antares686
February 20th, 2003, 05:22 AM
There are quit a few steaps. The best place to start thou is here ADO Programmer's Reference (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/pg_ado_fundamentals.asp) and work your way thru ADO API Reference looking at Connection, Command, and Recordset objects.
There are C++ examples throughtout the section of the site but a good recordset one is here VC++ recordset example (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdaexamples_vc04_2.asp) .
Just keep in mind you are using COM objects so in C++ you must call ::CoInitialize(NULL) somewhere in the start of your code before the any ADO stuff is done. And when done you have to call ::CoUninitialize(). This can be at the start of the program but must be in the same class as the ADO pieces.
Anything specific let us know, just hard to give you a run down on all the pieces without writting a really long article.
Finally, the biggest hurdle you will face is this. Make sure you have the latest Orace drivers installed on the machine you want to run from and I mean use the Oracle drivers not the MS ones to ensure proper data type support (you have to install the Oracle ones to get the MS one to work anyway). Thn it is a matter of build a proper connection string for Oracle.
leeza
June 17th, 2005, 02:41 AM
i am using ms access 97 instead of sql do u think there is still a need of
oledb dsn?
and one more thing is that u have disscussed above sth like ::coinitialize
and un initialize
i have a piece of code
struct StartOLEProcess
{
StartOLEProcess( )
{
::CoInitialize(NULL);
}
~StartOLEProcess( )
{
::CoUninitialize( );
}
} _start_StartOLEProcess;
plz tell me either this is used in odbc or oledb
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.