home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Administrator / variables / drivers / odbc.cfm (.txt) < prev    next >
Encoding:
ColdFusion Encrypted Template  |  1999-04-12  |  7.0 KB  |  191 lines

  1. <!------------------------ DISPLAY_ENTRY_FORM Method -------------------------
  2.     Display entry boxes for this type of Backing Store.
  3. ------------------------------------------------------------------------------>
  4.  
  5. <CFIF Method IS "DisplayEntryForm">
  6.     <CFIF ParameterExists(AddBSWasPressed)>
  7.         <!---- The add button was pressed. Set form default values.---->
  8.         <CFSET lBSName                    = "#Name#">
  9.         <CFSET lTimeout                    = "10">
  10.         <CFSET lDoPurge                    = "1">
  11.         <CFSET lCreateTables            = "1">
  12.         <CFSET lDisableGlobals            = "0">
  13.  
  14.     <CFELSEIF ParameterExists(EditLinkWasPressed)>
  15.         <!---- The Edit link was pressed. Get data from the registry ---->
  16.         <CFSET lBSName                    = "#Name#">
  17.         <CFSET lTimeout                    = "10">
  18.         <CFSET lDoPurge                    = "1">
  19.         <CFSET lCreateTables            = "0">
  20.         <CFSET lDisableGlobals            = "0">
  21.         <CFSET lDescription                = "ODBC Data Source">
  22.         
  23.         <CFNewInternalRegistry ACTION=GET VARIABLE="lTimeout"
  24.             ENTRY="Timeout"
  25.             TYPE="STRING"
  26.             BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#Name#">
  27.  
  28.         <CFNewInternalRegistry ACTION=GET VARIABLE="lDoPurge"
  29.             ENTRY="DoPurge"
  30.             TYPE="STRING"
  31.             BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#Name#">
  32.  
  33.         <CFNewInternalRegistry ACTION=GET VARIABLE="lDisableGlobals"
  34.             ENTRY="DisableGlobals"
  35.             TYPE="STRING"
  36.             BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#Name#">
  37.  
  38.         <CFNewInternalRegistry ACTION=GET VARIABLE="lDescription"
  39.             ENTRY="Description"
  40.             TYPE="STRING"
  41.             BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#Name#">
  42.     </CFIF>
  43.  
  44.     <CFOUTPUT>            
  45.     <TR>
  46.         <TD COLSPAN=2>
  47.         <CFIF lDoPurge IS 1>
  48.             <INPUT Name="DoPurgeCheckbox" Type="CHECKBOX" Value="1" CHECKED>
  49.         <CFELSE>
  50.             <INPUT Name="DoPurgeCheckbox" Type="CHECKBOX" Value="0">
  51.         </CFIF>
  52.         <FONT SIZE="#FONTSIZE#" FACE="#FONTFACE#">
  53.             <B>Purge data for clients that remain unvisted for</B> 
  54.             <INPUT Name="Timeout" Type="TEXT" Value="#lTimeout#" Size=3 MaxLength=3 onFocus="select()">
  55.             <B>days.</B>
  56.             <BR>
  57.             Enable this option if you want ColdFusion to periodically purge client data 
  58.             that has not been accessed in the specified number of days. 
  59.             <P>
  60.             If this data source is being used by more than one ColdFusion server, as in the case of clustered servers,
  61.             make sure that only one server in the cluster is configured to purge client data.
  62.         </FONT>
  63.         <BR><BR>
  64.         </TD>
  65.     </TR>
  66.     <TR>
  67.         <TD COLSPAN=2>
  68.         <CFIF lDisableGlobals IS 1>
  69.             <INPUT Name="DisableGlobalsCheckbox" Type="CHECKBOX" Value="1" CHECKED>
  70.         <CFELSE>
  71.             <INPUT Name="DisableGlobalsCheckbox" Type="CHECKBOX" Value="0">
  72.         </CFIF>
  73.         <FONT SIZE="#FONTSIZE#" FACE="#FONTFACE#">
  74.             <B>Disable global client variable updates</B>
  75.             <BR>This option controls how ColdFusion updates global client variables, such as HITCOUNT and LASTVISIT. If updates
  76.             are disabled, ColdFusion updates these variables only when they are set or modified. If updates are enabled, 
  77.             ColdFusion updates global client variables for each page request.
  78.         </FONT>
  79.         <BR><br>
  80.         </TD>
  81.     </TR>
  82.     <CFIF ParameterExists(AddBSWasPressed)>
  83.         <TR></TR>
  84.         <TR>
  85.             <TD COLSPAN=2>
  86.             <CFIF lCreateTables IS 1>
  87.                 <INPUT Name="CreateTablesCheckbox" Type="CHECKBOX" Value="1" CHECKED>
  88.             <CFELSE>
  89.                 <INPUT Name="CreateTablesCheckbox" Type="CHECKBOX" Value="0">
  90.             </CFIF>
  91.             <FONT SIZE="#FONTSIZE#" FACE="#FONTFACE#">
  92.                 <B>Create Client database tables</B>
  93.                 <BR>
  94.                 Enable this option only if this is the first time you are configuring
  95.                 the current data source for client variable storage. If the current data source has
  96.                 already been configured for client variable storage, do not enable this option. 
  97.                 
  98.             </FONT>
  99.             <BR>
  100.             </TD>
  101.         </TR>
  102.     </CFIF>
  103.     </CFOUTPUT>    
  104. </CFIF>
  105.  
  106.  
  107. <!------------------------ UPDATE_DATASOURCE Method -------------------------
  108.     Processes the creation of a new backing store in the registry. This routine
  109.     is used both when creating a new or updating an old backing store. 
  110. ------------------------------------------------------------------------------>
  111.  
  112. <CFIF Method IS "UpdateBackingStore">
  113.     <!----- Create a new key for the data source ----->                                    
  114.     <CFNewInternalRegistry ACTION=SET
  115.                     BRANCH="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores" 
  116.                     TYPE="KEY" 
  117.                     ENTRY="#Form.Name#">        
  118.  
  119.     <!---- Set entries for this type ---->
  120.     <CFNewInternalRegistry ACTION=SET
  121.         ENTRY="Description"
  122.         VALUE="#FORM.Description#"
  123.         TYPE="STRING"
  124.         BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#FORM.Name#">
  125.     <CFNewInternalRegistry ACTION=SET
  126.         ENTRY="Type"
  127.         VALUE="odbc"
  128.         TYPE="STRING"
  129.         BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#FORM.Name#">
  130.     <!---- Set registry entries based on FORM values ---->
  131.     <CFIF ParameterExists(FORM.DoPurgeCheckBox)>
  132.         <CFSET lDoPurge="1">
  133.     <CFELSE>
  134.         <CFSET lDoPurge="0">
  135.     </CFIF>
  136.     <CFNewInternalRegistry ACTION=SET
  137.         ENTRY="DoPurge"
  138.         VALUE="#lDoPurge#"
  139.         TYPE="STRING"
  140.         BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#FORM.Name#">
  141.     <CFNewInternalRegistry ACTION=SET
  142.         ENTRY="Timeout"
  143.         VALUE="#FORM.Timeout#"
  144.         TYPE="STRING"
  145.         BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#FORM.Name#">
  146.  
  147.     <CFIF ParameterExists(FORM.DisableGlobalsCheckBox)>
  148.         <CFSET lDisableGlobals="1">
  149.     <CFELSE>
  150.         <CFSET lDisableGlobals="0">
  151.     </CFIF>
  152.     <CFNewInternalRegistry ACTION=SET
  153.         ENTRY="DisableGlobals"
  154.         VALUE="#lDisableGlobals#"
  155.         TYPE="STRING"
  156.         BRANCH ="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores\#FORM.Name#">
  157.  
  158. </CFIF>
  159.  
  160. <!------------------------ DELETE_BACKINGSTORE Method -------------------------
  161.    Remove registry entries for this Backing Store.
  162. ------------------------------------------------------------------------------>
  163.  
  164. <CFIF Method IS "DeleteBackingStore">
  165.     <CFIF #BackingStoreToDelete# IS NOT "">
  166.         <!--- DSN changed. Delete the DS record from the list of data sources ----> 
  167.         <CFNewInternalRegistry ACTION=DELETE
  168.                 BRANCH = "HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\ClientStores"
  169.                 ENTRY     = "#BackingStoreToDelete#"
  170.                 TYPE    = "KEY">
  171.                         
  172.     </CFIF>
  173. </CFIF>
  174.  
  175.  
  176. <!------------------------ VALIDATE_FORM_DATA Method -------------------------
  177.     Validates the form fields coming from a Create\Edit data source form.
  178.     Any validation errors are communicated to the calling module in :
  179.     
  180.     VFD_bErrorMessage    - The text of the validation error message.
  181. ------------------------------------------------------------------------------>
  182.  
  183. <CFIF Method IS "ValidateFormData">    
  184.     <CFSET VFD_bErrorMessage = "">
  185.  
  186.     <CFIF isNumeric(Timeout) IS "NO" OR Timeout LT 0>
  187.         <CFSET VFD_bErrorMessage = "The client timeout must be set to zero or more days.">
  188.     </CFIF>
  189.     
  190. </CFIF>
  191.