General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only