Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO - Find field ordinal
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00523996
Message ID:
00525300
Views:
20
>HI!
>
>I was reading that accessing a field object by ordinal is 400 % faster..
>
>For example:
>
>oRS.fields("name").value
>vs
>oRS.fields(0).value
>
>Well I can't really use this I have an idea.
>I'll save the ordinal value in a class property after the first look up.
>So that at least refreshes are faster in code like..
>
>this.value=oRS.fields(this.name).value
>
>The question is if I have a fields object how do I get the ordinal.
>I checked all the properties and couldn't find a way to do it...
>Except...
>FOR i=0 to oRS.fields.count
> IF oRS.fields.name="name"
> ?i
> END
>ENDFOR
>Which can't be faster...
>
>So If I'm unclear. I am looking for a way to return the ordinal position of a field object knowing it's name..
>oRS.fields("name").value=oRS.fields(n).value
>How can I find n when I know "name"?
>
>Thanks

Dude, using ordinals is a VERY BAD IDEA! When you start calling stroed procedures and those stored procedures contain joins of tables AND when those table at the FIRST part of the join have columns added to them - ALL ORDINAL REFERENCES AFTER THAT COLUMN ARE THEN WRONG! We had to pull all ordinal references out just because of this.
Carl R. Perkins
NJ5J Software Corp. http://www.nj5j.com
Previous
Reply
Map
View

Click here to load this message in the networking platform