Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Script to update databases, tables and index
Message
De
12/07/2007 19:10:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00719461
Message ID:
01239976
Vues:
10
>Hi Naomi,
>
>>He-he, you never did :) Anyway, not a problem, I'll find it. Here, for example, Thread #1029054
>
>Actually, I did! :-) I just forgot to upload it here! :-)
>
>This code just create a new database in a new folder (C:\NEW_FOLDER) and then copy all records from an old folder (C:\OLD_FOLDER). To create a new database, I use GENDBC.PRG that you can find in VFP folder.
>
>I will copy code here, I think it will help you to create your own script.
>
>
>m.BDDC_Origem = "C:\OLD_FOLDER"
>m.BDDC_Destino = "C:\NEW_FOLDER"
>
>Open Database C:\NEW_FOLDER\YOURDATABASE.DBC
>AdbObjects(BDDC_Tabela, "Table")
>
>For m.BDDC_NoTabela = 1 To Alen(BDDC_Tabela,1)
>	If File(m.BDDC_Origem+BDDC_Tabela[m.BDDC_NoTabela]+".DBF") .and. File(m.BDDC_Destino+BDDC_Tabela[m.BDDC_NoTabela]+".DBF")
>		Wait Window NoWait "MOVING DATA: "+Alltrim(m.BDDC_Banco)+" - TABELA: "+BDDC_Tabela[m.BDDC_NoTabela]
>		Use (m.BDDC_Origem+BDDC_Tabela[m.BDDC_NoTabela])
>		Append From (m.BDDC_Destino+BDDC_Tabela[m.BDDC_NoTabela])
>	EndIf
>	Wait Clear
>EndFor
>
>
>I hope this help!

Except that it needs to turn off the RI, if any. And in case something goes wrong, and you have to repeat this, you may add zapping of the target tables so you wouldn't append the same records twice and you wouldn't need to recreate empty tables.

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