Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>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!
Hi, Esteban.
Thank you for the tip. Let me try it
alex
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement