Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create table based on variable name
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00367288
Message ID:
00367296
Vues:
26
>Is there a way to create a table using variable name. For example if I generate a random number using rand(), and put that number in variable, how can I use that variable name to create a table. Also, how can I use that variable name to attach to controlsource in grid.
>
>ranvar = rand()
>
>create table ranvar ....
>
>grid1.column1.controlsource = ranvar.cto
>
>I am having a problem creating a table based on value in variable ranvar and also attaching this value (which contains table name) to grid controlsource. Help appreciated
>
>thanks
>Nick Patel

The variable have to have the character value in order to be used for the table name. I would suggest to use SYS(2015) to generate the name:

ranvar = SYS(2015)
create table (ranvar) (cto c(10))
grid1.RecordSource = ranvar
grid1.column1.controlsource = ranvar+".cto"
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform