Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Script to update databases, tables and index
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00719461
Message ID:
01239876
Views:
12
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!

Today, I'm using xCase to update SQL Server databases. I'm trying to stop to use DBC/DBF files.

Good luck!
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform