mparam
asked on
C++ and ADODB- Retreiving all the fields of a row with Recordset
hi all,
I have to make an application which would talk to two databases : Sybase and Oracle and check whether all the fields in all the tables in both the databases are in sync.
The issue is I am unable to retreive all the columns with the recordset. I found many examples and code snippets on the net which retrieves specific column of each row using bstr = recordset->field->item->va lue. this is not feasible since the tables differ in their number of columns and some of them have upto 20 columns.
Is there a way I can get all the coulmns of each row print it on the output.
I would later write a parser which would compare the output from the tables across sybase and oracle.
I have to make an application which would talk to two databases : Sybase and Oracle and check whether all the fields in all the tables in both the databases are in sync.
The issue is I am unable to retreive all the columns with the recordset. I found many examples and code snippets on the net which retrieves specific column of each row using bstr = recordset->field->item->va
Is there a way I can get all the coulmns of each row print it on the output.
I would later write a parser which would compare the output from the tables across sybase and oracle.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
On trying to compile the code I get the following errors at line 2. could you please help?
C:\my program\dld\seccompas\data base.cpp(1 02) : error C2065: 'adOpenStatic' : undeclared identifier
C:\my program\dld\seccompas\data base.cpp(1 02) : error C2065: 'adLockOptimistic' : undeclared identifier
C:\my program\dld\seccompas\data base.cpp(1 02) : error C2065: 'adCmdTable' : undeclared identifier
C:\my program\dld\seccompas\data base.cpp(1 03) : error C2065: 'adCmdText' : undeclared identifier
line1 dbrs.CreateInstance("ADODB .Recordset ");
line2 dbrs->Open (table_name, _variant_t((IDispatch *) dbcn,true), adOpenStatic, adLockOptimistic, adCmdTable);
C:\my program\dld\seccompas\data
C:\my program\dld\seccompas\data
C:\my program\dld\seccompas\data
C:\my program\dld\seccompas\data
line1 dbrs.CreateInstance("ADODB
line2 dbrs->Open (table_name, _variant_t((IDispatch *) dbcn,true), adOpenStatic, adLockOptimistic, adCmdTable);
To use those constants, you'll need to specify the namespace :
ADODB::adOpenStatic
Or specify no namespace on your import:
#import "C:\Program Files\Common Files\System\ado\msado15.d ll" rename("EOF","adoEOF") no_namespace
ADODB::adOpenStatic
Or specify no namespace on your import:
#import "C:\Program Files\Common Files\System\ado\msado15.d
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
ASKER