Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create table from variable contents
Message
De
19/02/2005 10:23:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
19/02/2005 10:18:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00988590
Message ID:
00988592
Vues:
26
This message has been marked as the solution to the initial question of the thread.
>I have a need to create a table based on an existing table.
>
>The new table name will be entered into a textbox by the user.
>
>A Copy Structure(VFP) or Create table(SQL) example is what I require.

The piece you are probably missing is the "name expression": put the variable within parentheses, as in the last line of the following sample:
local lcTable
lcTable = alltrim(ThisForm.TxtTable.Value)
use MyTable
copy structure to (lcTable)
An alternative is "macro substitution":
...
copy structure to &lcTable
but this is slower in most cases.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform