Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating and using tables dynamically
Message
From
23/01/1999 07:55:54
George Alexander
Qatar Armed Forces
Doha, Qatar
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00178915
Message ID:
00179367
Views:
27
>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
Map
View

Click here to load this message in the networking platform