V4RB getting table name from cursor

Tim Davis timdavis at amug.org
Sun Dec 7 14:16:27 CST 2003


Hi Ruslan,

>>   I've been getting the field name and values in a cursor (using
>> c.Field(i).Name & c.Field(i).GetString), now I want to add the table
>> name (due to a multi-table SQL query). What is wrong with this syntax,
>> (I get NilObjectEx)?
>> c.Field(i).BaseObject.Name
>
> This not works not for local db, not for client.
> This is wrong idea I believe.
> Cursor itself DO NOT have any info about original tables.

I understand, but let me convey my situation (which is probably not 
really unique).
I'm displaying the results of a multi-table query into a grid 
(column-row). I name the columns with the field names. But in this 
particular case the field names are the same between the tables, so I 
want to differentiate the columns. Example; if I query just the IDs (my 
"ID"s or RecIDs) of two or more tables, it would be nice to display the 
table name also, rather than the columns having the same names.
I also understand that generally that many, if not most, fields between 
tables of a relational db will have unique field names. But such is not 
always the case, and it would be nice to be able to refer to the table 
the fields (and data) came from.

Thanks,
Tim Davis



More information about the Valentina mailing list