home *** CD-ROM | disk | FTP | other *** search
- <META NAME="Author" CONTENT="Copyright 1996 Allaire Corp. All rights reserved.">
- <META NAME="Version" CONTENT="$Revision: 17 $ $Modtime: 3/24/99 11:11a $">
-
- <HTML>
- <HEAD><TITLE>ColdFusion Administrator - Client Backingstore Data Sources</TITLE></HEAD>
- <body bgcolor="white">
- <!--- General page formatting is controled by this template --->
- <cfinclude template="../formatting/header.cfm">
-
- <CFPARAM name="BSDriver" default="odbc">
- <CFIF ParameterExists(CreateBackingStore)>
- <!--- These two lists are supported Databases and their driver files --->
- <CFSET DBDriverFiles="">
- <CFSET DBTypes="">
- <CFIF #Server.OS.Name# IS NOT "UNIX">
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "access.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft Access Driver (*.mdb)")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft FoxPro Driver (*.dbf)")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft dBase Driver (*.dbf)")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft ODBC Driver for Oracle")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sqlserver.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "SQL Server")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "paradox.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft Paradox Driver (*.db)")>
- <!---- OLEDB Drivers ---->
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "access.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Microsoft.Jet.OLEDB.3.51")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sqlserver.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "SQLOLEDB")>
- <CFELSE>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sybase.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv Sybase Driver")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv Oracle Driver")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "informix.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv INFORMIX Driver")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "dbase.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv dBase/FoxPro Driver")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "db2.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv IBM DB2/6000 Driver")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "openingres.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Intersolv OpenIngres Driver")>
- </CFIF>
- <!---- Native Drivers ---->
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle73")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "oracle.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Oracle80")>
- <CFSET DBDriverFiles = ListAppend(#DBDriverFiles#, "sybase.cfm")>
- <CFSET DBTypes = ListAppend(#DBTypes#, "Sybase11")>
- </CFIF>
-
- <CFIF ParameterExists(CreateBackingStore) OR ParameterExists(UpdateBackingStore)>
- <!---- Validate form data --->
- <CFSET Method = "ValidateFormData">
- <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
-
- <CFIF VFD_bErrorMessage IS "">
- <!---- Call the routine to create client tables if they don't exist --->
- <CFIF ParameterExists(CreateBackingStore) AND ParameterExists(CreateTablesCheckbox)>
- <CFSET iIndex = ListFindNoCase(#DBTypes#, #Type#)>
- <CFIF iIndex IS NOT 0>
- <CFSET driver=ListGetAt(#DBDriverFiles#, #iIndex#)>
- <CFSET DSN=#Name#>
- <CFTRY>
- <CFINCLUDE TEMPLATE="drivers/#driver#">
- <CFCATCH Type="Database">
- <CFSET Error_Message = "Unable to create client tables <br>If they already exist, you should uncheck Create Client Tables.<P>">
- <CFSET Error_Message = Error_Message & CFCATCH.message>
- <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
- <CFABORT>
- </CFCATCH>
- </CFTRY>
- <CFELSE>
- <CFSET Error_Message = "Unknown database type - Unable to create client tables<br>Please uncheck Create Client Tables.">
- <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
- <CFABORT>
- </CFIF>
- </CFIF>
- <!---- Call the UpdateDataSource method of the specific CF Driver --->
- <CFSET Method = "UpdateBackingStore">
- <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
-
- <!---- Tell the engine to refresh from the registry ---->
- <CFSET bSuccess = cfusion_settings_refresh()>
-
- <!---- Display the main page ---->
- <CFLOCATION URL="index.cfm">
- <CFELSE>
- <!--- Validation error eccured throw an error. --->
- <CFSET Error_Message = #VFD_bErrorMessage#>
- <CFINCLUDE TEMPLATE="../include/errormessage.cfm">
- <!--- General page formatting is controled by this template --->
- <cfinclude template="../formatting/header.cfm">
- <CFABORT>
- </CFIF>
-
- <CFELSEIF ParameterExists(DeleteBackingStore)>
- <!----Call the DeleteDatasource method of the specific CF Driver --->
- <CFSET Method = "DeleteBackingStore">
- <CFSET BackingStoreToDelete = "#Name#">
- <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
-
- <!---- Tell the engine to refresh from the registry ---->
- <CFSET bSuccess = cfusion_settings_refresh()>
-
- <!---- Display the main page ---->
- <CFLOCATION URL="index.cfm">
-
- <CFELSEIF ParameterExists(Cancel)>
- <!----- The CANCEL button was pressed. Return to the main page ---->
- <CFLOCATION URL="index.cfm">
- </CFIF>
-
- <!----------------------------------------------------------------------------
- Display of Backing Store creation\editing forms.
- ------------------------------------------------------------------------------>
- <CFIF ParameterExists(EditLinkWasPressed)>
- <!--- The BS link was clicked. Build Update form.--->
- <CFSET Operation = "Edit">
-
- <CFELSEIF ParameterExists(AddBSWasPressed)>
- <!--- The Add button was clicked. Build Create form.--->
- <CFSET Operation = "Create">
-
- <!--- Get the Datasource name, type, and driver --->
- <CFSET Name=ListGetAt(#FORM.DSList#, #Index#)>
- <CFSET Type=ListGetAt(#FORM.DSTypeList#, #Index#)>
- <CFSET BSDriver=ListGetAt(#Form.DSDriverList#, #Index#)>
-
- <CFSET NativeList="Sybase11,Oracle73,Oracle80">
- <!---- OLEDB Drivers ---->
- <CFSET OLEDBList="Microsoft.Jet.OLEDB.3.51,SQLOLEDB,OLEDB">
-
- <CFIF ListFindNoCase(#NativeList#, #Type#) IS NOT 0>
- <CFSET Description="Native Data Source">
- <CFELSEIF ListFindNoCase(#OLEDBList#, #Type#) IS NOT 0>
- <CFSET Description="OLEDB Data Source">
- <CFELSE>
- <CFSET Description="ODBC Data Source">
- </CFIF>
- </CFIF>
-
- <CFIF (ParameterExists(EditLinkWasPressed) OR ParameterExists(AddBSWasPressed))>
- <CFOUTPUT>
- <FORM ACTION="editcbsinfo.cfm" METHOD="POST">
- <INPUT TYPE="hidden" NAME="Name" VALUE="#Name#">
- <INPUT TYPE="hidden" NAME="BSDriver" VALUE="#BSDriver#">
- <INPUT TYPE="hidden" NAME="Operation" VALUE="#Operation#">
- <INPUT TYPE="hidden" NAME="Description" VALUE="#Description#">
- <CFIF #Operation# IS "Create">
- <INPUT TYPE="hidden" NAME="Type" VALUE="#Type#">
- </CFIF>
- </CFOUTPUT>
-
- <!---- Compose the banner of the edit entry form ---->
- <FONT FACE="Arial" SIZE="+1">
- <CFOUTPUT>
- #Operation# Client Variable Storage: #Name#<P>
- </CFOUTPUT>
- </FONT>
-
- <!-------------------------- RENDER THE ENTRY\UPDATE FORM ----------------------------->
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
- <!-------------- Display ODBC Driver specific form entries ----------->
- <CFSET Method = "DisplayEntryForm">
- <CFINCLUDE TEMPLATE="drivers/#BSDriver#.cfm">
-
- <!-------------------------------------- FORM BUTTONS ------------------------------------>
- <TR><TD COLSPAN=2><HR SIZE=1 NOSHADE><TD></TR>
- <TR>
- <TD COLSPAN=2 NOWRAP>
- <CFIF Operation IS "Edit">
- <INPUT TYPE="submit" NAME="UpdateBackingStore" VALUE="Update">
- <CFIF Name IS NOT "Registry">
- <INPUT TYPE="submit" NAME="DeleteBackingStore" VALUE="Delete">
- </CFIF>
- <CFELSEIF Operation IS "Create">
- <INPUT TYPE="submit" NAME="CreateBackingStore" VALUE="Create">
- </CFIF>
- <INPUT TYPE="submit" NAME="Cancel" VALUE="Cancel">
- </TD>
- </TR>
- </TABLE>
- </FORM>
- </CFIF>
- <!--- General page formatting is controled by this template --->
- <cfinclude template="../formatting/footer.cfm">
-