Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pointers or Macro Substitution?
Message
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
VBScript
Titre:
Pointers or Macro Substitution?
Divers
Thread ID:
00362706
Message ID:
00362706
Vues:
47
Is it possible to work with pointers (a la macro substitution in VFP) in VBScript? I'm trying to create some generic scripts to handle data processing and need this ability. As an example:

I want to loop through the Fields collection of a recordset. For each item in the Fields collection, I want to programmatically create a variable by prepending "str" to Fields.Name. Then I want to assign that variable the Fields.Value property. In VFP, it would look like:

oConnection = CreateObject("adodb.connection")
oConnection.Open("Source")

oRecordSet = CreateObject("adodb.recordset")
oRecordSet.Open("Select * From Plan!Inhouse Order By Latiname", oConnection)

For Each Item In oRecordSet.Fields
strTemp = "str" + Item.Name
* Substitute the value of strTemp and assign the fields value
&strTemp = Item.Value
EndFor

At this point, I would have a set of variables available to me with the proper value assigned. Any help or ideas are as always appreciated.

TIA, Bill
Oct 31 = Dec 25
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform