NOW....

No-one is suggesting that you should decrypt the Cold Fusion Adminstrator
code......

BUT....

They do all of this through calls to code somewhere in CFADMIN.......

AND I am guessing it is a lot of Java object calls in CFSCRIPT......

SO....

It should be possible to make those calls from your own pages - if you only
knew what the objects were and how to call the methods.

I remember an "Undocumented Cold Fusion" website that showed some of these
techniques for earlier CF versions (which allowed you to verify datasources
and reset them by calling CFSCRIPT functions).

Of course..... doing any of this may break with a later release or upgrade
- but that may be the price you have to pay for this type of functionality
(unless MM are prepare to expose some of this functionality and make it a
standard part of the CF codespace).

.....just some food for thought......



Gary Menzel
IT Operations Brisbane -+- ABN AMRO Morgans Limited
Level 29, 123 Eagle Street BRISBANE QLD 4000
PH: 07 333 44 828 �FX: �07 3834 0828

[EMAIL PROTECTED] wrote on 01/29/2003 09:16:50 AM:

> Here's one I use to automatically create DSNs for SQL server, it
> works on CF5 don't know about CFMX??
> It probably needs a bit of modifying for your needs.
>
> Hope it helps.
> Taco Fleur
>
>
> <cfparam name="bSuccess" default="false" type="boolean">
> <cfset request.strDataSource = trim(form.strDataSource)>
> <cfset request.strDBServer = trim(form.strDBServer)>
> <cfset request.dbName = "whatever">
>
> <cfinclude template="inc_status.cfm">
>
> <cfflush>
>
> <cfflush interval="5">
>
> <!-------------------------------------------------------------------
> - Create an entry in the list of existing datasources
> -------------------------------------------------------------------->
> <script language="JavaScript" type="text/javascript">
> document.all.columnStatus.innerHTML = '1. Creating Datasource.<br>';
> </script>
> <cfregistry action="set"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
> � �type="string"
> � �entry="#request.strDataSource#"
> � �value="SQL Server">
> <!-------------------------------------------------------------------
> - Create a new key for the datasource
> -------------------------------------------------------------------->
> <cfregistry action="set"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI"
> � �type="KEY"
> � �entry="#request.strDataSource#">
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 15%</strong>';
> </script>
> <!-------------------------------------------------------------------
> - Create default entries for datasource
> -------------------------------------------------------------------->
> <cfregistry action="set"
> � �entry="Description"
> � �value="Main datasource for Content3 Managent Systems"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.strDataSource#">
> <cfregistry action="set"
> � �entry="Server"
> � �value="#request.strDBServer#"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.strDataSource#">
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 25%</strong>';
> </script>
> <!-------------------------------------------------------------------
> - Leave database entry empty if there is no existing datasource to
> - the SQL server. Otherwise point to our database
> - <cfregistry action="set" entry="Database" value="ourDBhere"
> type="STRING" branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.
> INI\#request.strDataSource#">
> -------------------------------------------------------------------->
>
> <!-------------------------------------------------------------------
> - Defined if we are using a trusted connection or not
> -------------------------------------------------------------------->
> <cfif isDefined("form.bTrustedConnection")>
> �<cfregistry action="set"
> � � entry="Trusted_Connection"
> � � value="1"
> � � type="STRING"
> � � branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.
> strDataSource#">
> <cfelse>
> �<cfregistry action="set"
> � � entry="Trusted_Connection"
> � � value=""
> � � type="STRING"
> � � branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.
> strDataSource#">
> </cfif>
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 50%</strong>';
> </script>
> <cfregistry action="set"
> � �entry="UseProcForPrepare"
> � �value="Yes"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.
> strDataSource#">
> <cfregistry action="set"
> � �entry="OEMTOANSI" value="Yes"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.strDataSource#">
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 65%</strong>';
> </script>
> <!-------------------------------------------------------------------
> - Get the DriverPath from the ODBC driver settings and set it for
> the data source.
> -------------------------------------------------------------------->
> <cfregistry action="get"
> � �entry="Driver"
> � �variable="regDriverPath"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\SQL Server">
> <cfregistry action="set"
> � �entry="Driver"
> � �value="#regDriverPath#"
> � �type="STRING"
> � �branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.strDataSource#">
>
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 75%</strong>';
> document.all.columnStatus.innerHTML = document.all.columnStatus.
> innerHTML + '2. Creating Database.<br>';
> </script>
> <cftry>
> �<cfquery name="qCreateDB" datasource="#request.strDataSource#">
> �IF EXISTS (SELECT �*
> � � FROM �master..sysdatabases
> � � WHERE �name = N'#request.dbName#')
> � DROP DATABASE #request.dbName#
> �CREATE DATABASE #request.dbName#
> �</cfquery>
> �<cfcatch type="database">
> � <cfset bSuccess = true>
> � <cfset error = error & "Could not create table " & cfcatch.Message
> & "<br>" & cfcatch.Detail & "<br>">
> �</cfcatch>
> </cftry>
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 95%</strong>';
> </script>
> <!-------------------------------------------------------------------
> - Point the connection to our database
> -------------------------------------------------------------------->
> <cfif bSuccess>
> �<cfregistry action="set"
> � � entry="Database"
> � � value="#request.dbName#"
> � � type="STRING"
> � � branch="HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\#request.
> strDataSource#">
> </cfif>
>
> <script language="JavaScript" type="text/javascript">
> document.all.columnPercentage.innerHTML = '<strong>Status 100% ALL
> DONE!</strong>';
> document.all.columnStatus.innerHTML = document.all.columnStatus.
> innerHTML + '3. Writing datasource include file.<br>';
> </script>
>
> ----- Original Message -----
> From: Knott, Brian
> To: CFAussie Mailing List
> Sent: Wednesday, January 29, 2003 8:20 AM
> Subject: [cfaussie] Bulk DSN
>
> Does any one know of �a way to create bulk DSN's. �We have a
> situation where we need to create 120 DSN. �Don't want to do them
> manually. �Can this be automated in MX or Win 2000 Sever
> Brian Knott
>
> Senior Database Developer
> QANTM Studio
> Phone (07) 3017 4331
> Mobile 0407 572127
> Email [EMAIL PROTECTED]
> Website <http://www.qantm.com.au/>
> This email is sent commercial-in-confidence. The contents of this
> email and attachments are intended for the addressee only and may be
> subject to the laws of copyright, confidential information and
> privacy. �You may only forward it on or otherwise copy or use it
> with the consent of the sender.
>
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/
> ---
> You are currently subscribed to cfaussie as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
>
> MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to