Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filters
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00262781
Message ID:
00262789
Views:
14
>can anyone tell me why i cannot filter the fields in my table properly using this code?
>
>set fields to partno, partname
>
>my program cannot run if i insert this particular line. what did i do wrong? is this not the way to filter fields from a table?

SET FIELDS limits access to fields in a table, but that may well have undesirable consequences; for example, if indexes exist on other fields of a table, things will die quickly. For a simple example, if another field happens to be the primary key or a candidate key and you do this, you'll never be able to successfully insert a new record in the table, since you couldn't access that field while the SET FIELDS statement was in effect (the INSERT statement is limited by the current SET FIELDS setting.)

I view it as a legacy from dBASE, and have not used it in VFP at all.

What exactly are you trying to do? If you're trying to display selected fields in a browse or grid, you should simply name the fields explicitly in code rather than trying to rely on 'automagic' filtering. Obviously, you can easily specify the set of fields to include in SQL SELECTs and the like...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform