 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Randy Yates Guest
|
Posted: Thu Dec 30, 2004 4:27 pm Post subject: Re: "Dynamic" Object Structures? |
|
|
=?ISO-8859-15?Q?Juli=E1n?= Albo <JULIANALBO (AT) terra (DOT) es> writes:
| Quote: | Randy Yates wrote:
The closest I can come is to define a recordset object that has a member
function
void * Fields(char* fName);
so that I can say
int year;
recordset rstCars("SELECT * FROM tblCars");
year = rstCars.Fields("fYear");
Is this a reasonable way to do this? Is there any mechanism in C++ to
do it more elegantly?
You can write an operator [ ] or operator ( ) instead of a function. But
surely many people will disagree about what way is more elegant.
|
That sounds like a great idea - at least the syntax would be even closer
to VB.
| Quote: | You can also create a Field class, create objects of this class with the
field names, and use those objects as parameters instead of string
literals.
|
Don't want to do that - duplication of effort. The fields should be inherently
identified by the class via the SQL query text.
Thanks for the ideas!
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
[email]randy.yates (AT) sonyericsson (DOT) com[/email], 919-472-1124
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|