Page 1 of 1
PutColumnData problem
Posted: Tue 12 Apr 2005 11:42
by Asif
Hi
I'm using Odac 4.50 and considering an upgrade to the latest version.
However, I've been told that the latest version of Odac only supports one version of the PutColumnData function. i.e , the following is supported
Loader->PutColumnData(1,2,"Hello");
and the following is no longer supported
Loader->PutColumnData("STRING",2,"Hello");
Is this true? Is the second version no longer supported?
Since the app I've created uses the second version, it means that I will not be able to upgrade
Posted: Tue 12 Apr 2005 13:02
by Alex
You were misinformed. ODAC supports both functionality you need. In all cases you can try trial version of the latest ODAC to make your decision.
Posted: Tue 12 Apr 2005 14:50
by Asif
Hi
I've downloaded the latest ODAC trial version from the website as you have suggested and it fails .
If I look at the OraLoader.hpp file , i see the following
__fastcall virtual TOraLoader(Classes::TComponent* Owner);
__fastcall virtual ~TOraLoader(void);
virtual void __fastcall PutColumnData(int Col, int Row, const Variant &Value)/* overload */;
virtual void __fastcall CreateColumns(void);
The version of ODAC that I have (4.50.0.15) has an extra line in the OraLoader.hpp file
__fastcall virtual TOraLoader(Classes::TComponent* Owner);
__fastcall virtual ~TOraLoader(void);
void __fastcall PutColumnData(int Col, int Row, const Variant &Value)/* overload */;
void __fastcall PutColumnData(AnsiString ColName, int Row, const Variant &Value)/* overload */;
void __fastcall Load(void);
void __fastcall CreateColumns(void);
Ive noticed that this line has been moved to DALoader.hpp which OraLoader.hpp derives from, so in theory it should work.
I've tried this with my existing app and with a newly created app.
In the newly created app I dropped a session component and a TOraLoader component. In the PutData function I added one line
OraLoader1->PutColumnData("Hello",4,"String");
I hooked neither component up to any database.
On compilation, I got the following error
E2342 Type mismatch in parameter 'Col' (wanted 'int', got 'char *')
Posted: Wed 13 Apr 2005 06:46
by Alex
Try to use next syntax when you call overloaded PutColumnData function:
Code: Select all
((TDALoader *)OraLoader1)->PutColumnData("Hello",4,"String");
Posted: Wed 13 Apr 2005 07:33
by Asif
That syntax seems to compile without errors
Thanks