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

  1. <META NAME="Author" CONTENT="Copyright 1996 Allaire Corp. All rights reserved.">
  2. <META NAME="Version" CONTENT="$Revision: 17 $ $Modtime: 3/24/99 11:11a $">
  3.  
  4. <HTML>
  5. <HEAD><TITLE>ColdFusion Administrator - Client Backingstore Data Sources</TITLE></HEAD>
  6. <body bgcolor="white">
  7. <!--- General page formatting is controled by this template --->
  8. <cfinclude template="../formatting/header.cfm">
  9.  
  10. <CFPARAM name="BSDriver" default="odbc">
  11. <CFIF ParameterExists(CreateBackingStore)>
  12.     <!--- These two lists are supported Databases and their driver files --->
  13.     <CFSET DBDriverFiles="">
  14.     <CFSET DBTypes="">
  15.     <CFIF #Server.OS.Name# IS NOT "UNIX">
  16.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "access.cfm")>
  17.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft Access Driver (*.mdb)")>
  18.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
  19.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft FoxPro Driver (*.dbf)")>
  20.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
  21.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft dBase Driver (*.dbf)")>
  22.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
  23.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft ODBC Driver for Oracle")>
  24.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
  25.         <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle")>
  26.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sqlserver.cfm")>
  27.         <CFSET DBTypes = ListAppend(#DBTypes#, "SQL Server")>
  28.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "paradox.cfm")>
  29.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft Paradox Driver (*.db)")>
  30.         <!---- OLEDB Drivers ---->    
  31.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "access.cfm")>
  32.         <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft.Jet.OLEDB.3.51")>
  33.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sqlserver.cfm")>
  34.         <CFSET DBTypes = ListAppend(#DBTypes#, "SQLOLEDB")>
  35.     <CFELSE>
  36.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sybase.cfm")>
  37.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv Sybase Driver")>
  38.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
  39.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv Oracle Driver")>
  40.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "informix.cfm")>
  41.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv INFORMIX Driver")>
  42.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
  43.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv dBase/FoxPro Driver")>
  44.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "db2.cfm")>
  45.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv IBM DB2/6000 Driver")>
  46.         <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "openingres.cfm")>
  47.         <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv OpenIngres Driver")>    
  48.     </CFIF>
  49.     <!---- Native Drivers ---->
  50.     <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
  51.     <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle73")>    
  52.     <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
  53.     <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle80")>    
  54.     <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sybase.cfm")>
  55.     <CFSET DBTypes = ListAppend(#DBTypes#, "Sybase11")>    
  56. </CFIF>
  57.  
  58. <CFIF ParameterExists(CreateBackingStore) OR ParameterExists(UpdateBackingStore)>
  59.     <!---- Validate form data  --->
  60.     <CFSET Method = "ValidateFormData">
  61.     <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
  62.  
  63.     <CFIF VFD_bErrorMessage IS "">
  64.         <!---- Call the routine to create client tables if they don't exist --->
  65.         <CFIF ParameterExists(CreateBackingStore) AND ParameterExists(CreateTablesCheckbox)>
  66.             <CFSET iIndex = ListFindNoCase(#DBTypes#, #Type#)>
  67.             <CFIF iIndex IS NOT 0>
  68.                 <CFSET driver=ListGetAt(#DBDriverFiles#, #iIndex#)>
  69.                 <CFSET DSN=#Name#>
  70.                 <CFTRY>
  71.                 <CFINCLUDE TEMPLATE="drivers/#driver#">
  72.                 <CFCATCH Type="Database">
  73.                     <CFSET Error_Message = "Unable to create client tables <br>If they already exist, you should uncheck Create Client Tables.<P>">
  74.                     <CFSET Error_Message = Error_Message & CFCATCH.message>
  75.                     <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
  76.                     <CFABORT>
  77.                 </CFCATCH>
  78.                 </CFTRY>
  79.             <CFELSE>
  80.                 <CFSET Error_Message = "Unknown database type - Unable to create client tables<br>Please uncheck Create Client Tables.">
  81.                 <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
  82.                 <CFABORT>
  83.             </CFIF>
  84.         </CFIF>
  85.         <!---- Call the UpdateDataSource method of the specific CF Driver --->
  86.         <CFSET Method = "UpdateBackingStore">    
  87.         <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
  88.  
  89.         <!---- Tell the engine to refresh from the registry ---->
  90.         <CFSET bSuccess = cfusion_settings_refresh()>
  91.  
  92.         <!---- Display the main page ---->
  93.         <CFLOCATION URL="index.cfm">        
  94.     <CFELSE>
  95.         <!--- Validation error eccured throw an error. --->
  96.         <CFSET Error_Message = #VFD_bErrorMessage#>
  97.         <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
  98.         <!--- General page formatting is controled by this template --->
  99.         <cfinclude template="../formatting/header.cfm">
  100.         <CFABORT>
  101.     </CFIF>
  102.         
  103. <CFELSEIF ParameterExists(DeleteBackingStore)>
  104.     <!----Call the DeleteDatasource method of the specific CF Driver     --->
  105.     <CFSET Method = "DeleteBackingStore">    
  106.     <CFSET BackingStoreToDelete = "#Name#">    
  107.     <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
  108.  
  109.     <!---- Tell the engine to refresh from the registry ---->
  110.     <CFSET bSuccess = cfusion_settings_refresh()>
  111.  
  112.     <!---- Display the main page ---->    
  113.     <CFLOCATION URL="index.cfm">
  114.  
  115. <CFELSEIF ParameterExists(Cancel)>
  116.     <!----- The CANCEL button was pressed. Return to the main page ---->
  117.     <CFLOCATION URL="index.cfm">    
  118. </CFIF>
  119.  
  120. <!----------------------------------------------------------------------------
  121.     Display of Backing Store creation\editing forms.
  122. ------------------------------------------------------------------------------>
  123. <CFIF ParameterExists(EditLinkWasPressed)>
  124.     <!--- The BS link was clicked. Build Update form.--->
  125.     <CFSET Operation = "Edit">
  126.  
  127. <CFELSEIF ParameterExists(AddBSWasPressed)>
  128.     <!--- The Add button was clicked. Build Create form.--->
  129.     <CFSET Operation = "Create">
  130.  
  131.     <!--- Get the Datasource name, type, and driver --->
  132.     <CFSET Name=ListGetAt(#FORM.DSList#, #Index#)>
  133.     <CFSET Type=ListGetAt(#FORM.DSTypeList#, #Index#)>
  134.     <CFSET BSDriver=ListGetAt(#Form.DSDriverList#, #Index#)>
  135.  
  136.     <CFSET NativeList="Sybase11,Oracle73,Oracle80">
  137.     <!---- OLEDB Drivers ---->    
  138.     <CFSET OLEDBList="Microsoft.Jet.OLEDB.3.51,SQLOLEDB,OLEDB">
  139.     
  140.     <CFIF ListFindNoCase(#NativeList#, #Type#) IS NOT 0>
  141.         <CFSET Description="Native Data Source">
  142.     <CFELSEIF ListFindNoCase(#OLEDBList#, #Type#) IS NOT 0>
  143.         <CFSET Description="OLEDB Data Source">        
  144.     <CFELSE>
  145.         <CFSET Description="ODBC Data Source">
  146.     </CFIF>
  147. </CFIF>
  148.  
  149. <CFIF (ParameterExists(EditLinkWasPressed) OR ParameterExists(AddBSWasPressed))>
  150.     <CFOUTPUT>
  151.     <FORM ACTION="editcbsinfo.cfm" METHOD="POST">
  152.     <INPUT TYPE="hidden" NAME="Name"         VALUE="#Name#">
  153.     <INPUT TYPE="hidden" NAME="BSDriver"    VALUE="#BSDriver#">
  154.     <INPUT TYPE="hidden" NAME="Operation"     VALUE="#Operation#">
  155.     <INPUT TYPE="hidden" NAME="Description" VALUE="#Description#">
  156.     <CFIF #Operation# IS "Create">
  157.         <INPUT TYPE="hidden" NAME="Type" VALUE="#Type#">
  158.     </CFIF>
  159.     </CFOUTPUT>
  160.     
  161.     <!---- Compose the banner of the edit entry form ---->
  162.     <FONT FACE="Arial" SIZE="+1">        
  163.         <CFOUTPUT>
  164.         #Operation# Client Variable Storage: #Name#<P>
  165.         </CFOUTPUT>
  166.     </FONT>
  167.     
  168.     <!-------------------------- RENDER THE ENTRY\UPDATE FORM ----------------------------->
  169.     <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
  170.         <!-------------- Display ODBC Driver specific form entries ----------->
  171.         <CFSET Method = "DisplayEntryForm">
  172.         <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
  173.  
  174.     <!-------------------------------------- FORM BUTTONS ------------------------------------>
  175.     <TR><TD COLSPAN=2><HR SIZE=1 NOSHADE><TD></TR>
  176.     <TR>
  177.         <TD COLSPAN=2 NOWRAP>
  178.             <CFIF Operation IS "Edit">
  179.                 <INPUT TYPE="submit" NAME="UpdateBackingStore" VALUE="Update">
  180.                 <CFIF Name IS NOT "Registry">
  181.                     <INPUT TYPE="submit" NAME="DeleteBackingStore" VALUE="Delete">
  182.                 </CFIF>
  183.             <CFELSEIF Operation IS "Create">
  184.                 <INPUT TYPE="submit" NAME="CreateBackingStore" VALUE="Create">
  185.             </CFIF>
  186.             <INPUT TYPE="submit" NAME="Cancel" VALUE="Cancel">
  187.         </TD>
  188.     </TR>
  189.     </TABLE>
  190.     </FORM>
  191. </CFIF>
  192. <!--- General page formatting is controled by this template --->
  193. <cfinclude template="../formatting/footer.cfm">
  194.