Display datasources

8 March 2007 11:08 (EST)
<cfif left(server.ColdFusion.ProductVersion,1) le "5">
<cfregistry action="getall" name="DataSources" type="any" sort="entry"
branch="HKEY_LOCAL_MACHINE\SOFTWARE\allaire\coldfusion\currentversion\data-sources">

<cfoutput query="datasources">#datasources.entry#<br></cfoutput>
<cfelseif left(server.ColdFusion.ProductVersion,1) ge "6">
<cffile action="read" file="#server.coldfusion.rootdir#\lib\neo-query.xml" variable="thisxml">
<cfwddx action="wddx2cfml" input="#variables.thisxml#" output="aDsnInfo">
<cfset ldsn = "">
<cfloop collection="#aDsnInfo[3]#" item="thisdsn">
<cfset stInfo = aDsnInfo[3]>
<cfset stInfo = stInfo[thisdsn]>
<cfif stInfo.driver is "MSSQLServer" or stInfo.driver is "MSAccess" or stInfo.driver is "MSAccessJet">
<cfset ldsn = listappend(ldsn,variables.thisdsn)>
</cfif>
</cfloop>
<cfset ldsn = listsort(ldsn,"TextNoCase")>
<cfloop list="#ldsn#" index="thisdsn">
<cfoutput>#variables.thisdsn#<br></cfoutput>
</cfloop>
</cfif>

Discussion (no comments)

Add your comment
*
*
*
*
*

Captcha Code Please enter the number on the left.
Sorry for asking you to do so.
Reload image