Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating and using tables dynamically
Message
 
To
22/01/1999 09:40:25
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:
00178945
Views:
28
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform