Hello,
I am using ODAC v 9.7.26 on C++Builder 6.0 and I would like to add columns to a TOraLoader component at runtime.
I could not find any sample in the Help file, and the C++Builder demo is a little bit poor.
I was not able to find out how to add a TDAColumn to the Columns property of TOraLoader.
How can I do that? I am able to deal with Delphi code.
Thank you very much.
Best regards,
Jayme Jeffman Filho
How to add columns to TOraLoader at runtime
Re: How to add columns to TOraLoader at runtime
Never mind. I have got it to work using the same process used to add columns to a TDBGrid.
Best regards,
Jayme Jeffman Filho
Best regards,
Jayme Jeffman Filho
Re: How to add columns to TOraLoader at runtime
You can add columns to TOraLoader at runtime as follows. For example, for an integer field "ID" :
Code: Select all
...
TDAColumn* NewColumn;
NewColumn = (TDAColumn*)OraLoader -> Columns -> Add();
NewColumn -> Name = "ID";
NewColumn -> FieldType = ftInteger;
...
Re: How to add columns to TOraLoader at runtime
Hello Maxim,
Thank you very much for answerung me.
I did as you suggested, but as the application is connected to the database, and I need to fill up all tables fields, I am using the TOraLoader::CreateColumns() method every time I change the TOraLoader::TableName property, that did the trick.
Thank you very much.
Best regards,
Jayme Jeffman Filho
Thank you very much for answerung me.
I did as you suggested, but as the application is connected to the database, and I need to fill up all tables fields, I am using the TOraLoader::CreateColumns() method every time I change the TOraLoader::TableName property, that did the trick.
Thank you very much.
Best regards,
Jayme Jeffman Filho
Re: How to add columns to TOraLoader at runtime
You are absolutely right. The CreateColumns method creates all the fields of the table specified in the TableName property : https://www.devart.com/odac/docs/?devar ... umns().htm