Dynamic Database Switching: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
m
Correcting INT file entry
m (categories)
m (Correcting INT file entry)
 
(3 intermediate revisions by the same user not shown)
Line 90: Line 90:
       String sCurr
       String sCurr
        
        
       Get_Database_Name to sCurr  // Note: Mertech docs say not supported on MySQl,
       Get_Database_Name to sCurr
                                  // but seems to work.
   
       Move (Trim(sDB)) to sDB
      Move (Uppercase(Trim(sDB)))  to sDB
       Move (Uppercase(Trim(sCurr))) to sCurr
       If (sDB = sCurr) Procedure_Return  // Don't do more than we have to.
       If (sDB = sCurr) Procedure_Return  // Don't do more than we have to.
        
        
Line 227: Line 228:
</source>
</source>


This might be invoked in the login module of some applications, where the database to use is determined by the user's identity, or in the Session Manager module of an [[Ajax]] [[Web Application]] where the database to use is mainteined in the Session record, or simply in the change of a visual control (such as a Combo Form) in an application in which the user can choose between many databases to work on.
This might be invoked in the login module of some applications, where the database to use is determined by the user's identity, or in the Session Manager module of an [[Ajax]] [[Web Application]] where the database to use is maintained in the Session record, or simply in the change of a visual control (such as a Combo Form) in an application in which the user can choose between many databases to work on.


===In the .INT files===
===In the .INT files===


The Mertech Set_Database_Name command, on which the underlying functionality is based, will only be effective if the database is '''not''' set in the .INT file - so you should '''remove''' the line DATABASE_AREA_NAME=XXXX from the appropriate .INT files (and indeed probably from all the .INT files). Then the .TD files should be deleted so that they will be freshly regenerated on next access from the .INT files.
The Mertech Set_Database_Name command, on which the underlying functionality is based, will only be effective if the database is '''not''' set in the .INT file - so you should '''remove''' the line "'''DATABASE_SPACE_NAME XXXXX'''" from the appropriate .INT files (and indeed probably from all the .INT files). Then the .TD files should be deleted so that they will be freshly regenerated on next access from the .INT files.


[[Category:Database Connectivity]]
[[Category:Database Connectivity]]
[[Category:Tutorials]]
[[Category:Tutorials]]
[[Category:Cookbook]]
[[Category:Cookbook]]

Navigation menu