Ask a Question related to Coldfusion Database Access, Design and Development.
-
filesystem #1
List all available Datasources
Hi@all!
How can I do it, that I get all datasources that are registerd in the
CF-Server?
I tried somethin like that but it did'nt work:
<cfquery datasource="*" name="dbquery">
show databases;
</cfquery>
I hope there is a way because in the CF-Administrator it has ben done in a
way...
Can anyone help me please?
thx
filesystem Guest
-
Use CF Datasources outside CF
I need to create a JSP on the coldfusion server, and access coldfusion datasources in that JSP. Is there anyway to do this in CF6.1 or CF7. ... -
Dynamic Datasources?
I am porting an app from PHP to CF. The app requires the functionality to perform queries on different databases. I cannot utilize the CF Admin as... -
How to Provide a list of DataSources and Fields at design time
I'm developing an WebControl in ASP.NET 2.0. The control inherits from DataBoundControl, so it can be bound to a DataSourceControl by it's... -
CFMX Datasources
To my understanding, previous versions of Coldfusion did not allow you to connect to an Oracle datasource. I was wondering if CFMX Server has this... -
accessing two different datasources
I need to connect to 2 dfferent datasources that are in two different servers. Example: I need to move data from one table on server 1to a table... -
BKBK #2
Re: List all available Datasources
>... How can I do it, that I get all datasources that are registerd in the
CF-Server?
I shouldn't expect that to be possible, and wouldn't want it either. There
could be
security implications. I expect you can only get the list through the
Coldfusion
Administrator or through RDS. In any case, it would be technically difficult to
obtain the database names in an ordinary cfm page by means of cfml code.
Each datasource may come from a distinct server, may communicate with
Coldfusion via a distinct port and may or may not require its own set of
username and password. The cfquery tag, for example, cannot take all that in.
BKBK Guest
-
filesystem #3
Re: List all available Datasources
hmm I see, I was a littelbit wrong...
But can I for example list the Tables of a known DB?
filesystem Guest
-
BKBK #4
Re: List all available Datasources
>... hmm I see, I was a littelbit wrong...
No, you were not. What you ask for is possible, but not in the way you want.
Yes, and you can get the list of datasources, but only through CFAdmin.>... But can I for example list the Tables of a known DB?
Try this example. You will find the background information in the
[url]http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001734.htm[/url].
<cfscript>
adminObj = createObject("component","cfide.adminapi.administr ator");
createObject("component","cfide.adminapi.administr ator").login("your_CFAdmin_Pas
sword");
myObj = createObject("component","cfide.adminapi.datasourc e");
</cfscript>
<cfdump var="#myObj.getDatasources()#">
<!--- NB: The result, myObj.getDatasources(), is a structure --->
BKBK Guest
-
philh #5
Re: List all available Datasources
Depends on the database you're using. Access holds table names in the
MSysObjects table. MS SQL uses INFORMATION_SCHEMA views to return DB object
information. Oracle I'm sure has its own schema query approach.
philh Guest
-
BKBK #6
Re: List all available Datasources
>... list of tables IN a known db
MySQL: Run the query, "SHOW TABLES from datasourceName;"
MS SQL: Run the in-built stored procedure, sp_tables, for example
<cfstoredproc procedure="sp_tables" datasource="datasourceName">
<cfprocresult name="tbls">
</cfstoredproc>
<cfdump var="#tbls#">
BKBK Guest
-
-
BKBK #8
Re: List all available Datasources
>... Will this work for Access db?
I can't say. I hardly use Access. A quick look around, and you will find examples involving schema and [url]http://www.irt.org/script/3006.htm[/url].
BKBK Guest



Reply With Quote

