Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create table from variable contents
Message
From
19/02/2005 10:23:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
19/02/2005 10:18:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00988590
Message ID:
00988592
Views:
27
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)
Previous
Reply
Map
View

Click here to load this message in the networking platform