Dynamic Database Switching: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
m
typos
m (typos)
m (typos)
Line 139: Line 139:
   
   
<source lang="vdf">
<source lang="vdf">
Use DataDict.pkg  //  
Use DataDict.pkg  // The Data Access DD class


// We want to ensure that the global handle is defined, so that this
// We want to ensure that the global handle is defined, so that this
Line 199: Line 199:
===Without Data Dictionaries===
===Without Data Dictionaries===


If you need to have the database switching capability for tables you are opening directly, instead of using data dictionaries for them, you can just use the same call that was place in the data dictionary sub-class, but using the table's File_Number rather than the Main_File property:
If you need to have the database switching capability for tables you are opening directly, instead of using data dictionaries for them, you can just use the same call that was placed in the data dictionary sub-class, but using the table's File_Number rather than the Main_File property:


<source lang="vdf">
<source lang="vdf">
Line 218: Line 218:
Register_Procedure SwitchDB String sDatabase
Register_Procedure SwitchDB String sDatabase
</source>
</source>
(''Possibly this too might be placed in a package file of its own, including registering the AddCustomerTable procedure as well, since effectively it has already been used three times.'')


Then switching database becomes a simple matter of invoking that procedure:
Then switching database becomes a simple matter of invoking that procedure:

Navigation menu