Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a table from a table of a structure
Message
De
24/07/2008 17:43:45
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
24/07/2008 17:24:34
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 9
OS:
Windows XP SP2
Divers
Thread ID:
01333451
Message ID:
01333918
Vues:
9
>Dragan,
>
>we must be running on different configurations, since I can, without any errors, do the following:
>
>create table myTable
>close tables all && need to avoid the error "file is open for proceed. Under normal procedures myTable would have been created already longtime be4 and would have been used in 0
>use myTable in 0
>copy struc extended to myTable.txt
>create table2 from myTable.txt
>Anyhow your system also works like a charm and I will use my lines till I will stumble over an error.

Are you sure your table has memo fields? Because that's what'll cause the error. To copy structure extended you're basically creating a new table - and starting with VFP3, that table has memos, because it has to support all the dbc-related stuff like default expressions, triggers, display classes etc, which all have to go somewhere. So if you give the TO table the same name as the original table, you're creating a .dbf (or whichever extension you give it - .txt works, but it's still a .dbf inside) AND a .fpt (can't choose here, it'll try to make a fpt whatever you do). Now if your original table was table.dbf, and it had a memo, it has a table.fpt and that is already open by you, because you just opened the table to copy its structure out.

Try this:
*-- a dummy cursor, quite unimportant
create cursor zz (i i)

copy structure extended to dbfexte.dummy
close databases all
*-- if you want, quit VFP here, reload and run just these two lines:
use dbfexte.dummy
*-- bang, your code is dead:
copy structure extended to dbfexte.bzy

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform