Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating and using tables dynamically
Message
 
À
22/01/1999 09:40:25
George Alexander
Qatar Armed Forces
Doha, Qatar
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00178915
Message ID:
00178945
Vues:
29
Hi George!

To create the database and table, you can use the Home()\Tools\GenDBC\GenDBC.PRG program. This create a .PRG that construct DBC, DBF's, Index, Relations and views like the original Database.
Then run it and then moodify the code generated to change database and tables name to your convention!

Respect to the DE, you may do the follow:

* DE on the form, without objects (no cursors, no views)
* Add a Method MakeDataSession to your form Or base form class
* At the form Init method, add this line: This.MakeDataSession
* Write this code in MakeDataSession method:
cDatabase = FullPath( *yourdatabasename* + ".DBC" )
cTableName = *yourtablename*
This.DataEnvironment.AddObject( cTableName*, "cursor" )
This.DataEnvironment.&cTableName..Database = cDatabase
This.DataEnvironment.&cTableName..CursorSource = cTableName
This.DataEnvironment.&cTableName..Alias = cTableName
This.DataEnvironment.&cTableName..Exclusive = *If you want, .T., else .F.*
Repeat lines 2 to 7, for all tables that you want to add to the DE. And when you add it all the tables, write this lines:
This.DataEnvironment.CloseTables()
This.DataEnvironment.OpenTables()
Good Luck!
Lic. Esteban Bruno
Gerente de Sistemas
TASSO S.R.L.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform