Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem for getting infromation from the table.
Message
De
09/01/2002 03:02:32
 
 
À
09/01/2002 00:49:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00602363
Message ID:
00602385
Vues:
20
This message has been marked as the solution to the initial question of the thread.
>I am using the cross-tab query, every time when query is generate it create new field name. I have problem for getting the information from the table because I do not know the field name. Field() function tell me about the name of field but when I use it with the table name it does not show the information and generate the Error.
>
>For example :
>
>Table name = Address && getting cursor through cross-tab procedure.
>Filed name = field(1) && it show the field name “Street”
>When I use this with the table name it generates Error.
>
>---------------------------------------------
>Method 1
>--------
>1- X = address.field(1) && generate error…..
>
>Method 2
>--------
>1- f_name = field(1)
>2- X = address.f_name or address.&f_name && generate error.
>---------------------------------------------
>

At least one correct method:
x=eval('address.'+field(1))
>I have problem that I do not know the field name but I want to get the information from the table ….
>

Use AFIELDS() to get the array of field names and use the field name values either with EVAL() or name resolution. And you can always use SCATTER TO ArrayName to populate a array with field contents, or SCATTER TO NAME ObjName to create an object whose properties are the field names and the content is the field value, or SELECT into a 2D array if the data set is small enough.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform