Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a better way to do this?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00162439
Message ID:
00162440
Vues:
20
>I get a DB/table name to open from another DB/table full of DB/table names.
>
>Code looks something like this:
>
>dbnam = mydb.dbnames && Get DB name from list of DB names
>SELECT &dbnam && Select DB/table that came from list
>SEEKID = &dbnam.field1 && Get Seek ID value
>SEEK SEEKID && Seek the record
>IF FOUND()
> .....
> .....
>ENDIF
>
>But whenever I run the program and it encounters the SEEKID =
>&dbnam.field1 command, I get an error that &dbnam is not an object. I thought I had used a Macro substitution in the past just like this without error. Any ideas? Is there a better way to do it?
>
>I have read that one may use SELECT (dbnam) instead, but I get the same error, but better performance? Thanks.

Try:

dbnam = trim(mydb.dbnames
select 0
use (dbnam)
seekid = &dbnam..field1
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform