Ask a Question related to Coldfusion Database Access, Design and Development.
-
bweno #1
Get database field names from table...
How do you get the database fieldnames from a table and display them using cfquery and cfoutput.
Thanks a million...
bweno Guest
-
Database table names
In the database tab of the Application panel, when I go down the hierachy to the tables dreamweaver shows the full path instead of just the table... -
querying field / column names in Access table
I got great info on my last post, so let's try this one and see if my luck is still good: I have an Access table with about 30+ columns / fields... -
querying table names in a database
Hey Gang - Anyone have a fast and easy CFQUERY that can query all the table names in an Access database? TIA -
Table field names not visible
This morning I set up check in and check out to work on a site with someone else. Suddenly when looking at bindings details or any of the other... -
interrogating database for field names/datatypes?
I'm working primarily in ASP and transitioning to ASP.NET. This is probably entered to the wrong group but I'm not sure of what precise database... -
JMGibson3 #2
Re: Get database field names from table...
Assuming you've run a query returning one row and want to display details
(alphabetically, see below). This example is for one record listing the fields
top to bottom, label/value. If you want to show a bunch of records all at
once with horizontal columns (a la Excel) <cfgrid> will do it for you
automatically. <cfset colList = yourQuery.ColumnList> <cfloop index='ColName'
list='#colList#'> <tr> <cfoutput> <td align=right><b>#colName#:</b></td>
<td>#Evaluate('yourQuery.' & colName)#<br></td> </cfoutput> </tr> </cfloop>
You can also find/download a Custom tag to get them in physical DB sequence:
<CF_ColumnList Query='#yourQuery#' ColumnList='colList'>
JMGibson3 Guest
-
bweno #3
Re: Get database field names from table...
That works great!!!! The cf_ tag is awesome... Is there anyway to set to a list
of the values of the fields. The cf_ tag use a loop statement and everytime I
try and set it to a list and then output it comes up just showing the last
field value... Thanks in advance for all your help! <cfloop list='#colList#'
index='col'> <cfoutput> <cfset thelist = ''> <cfset thelist =
listappend(thelist, '#col#')> </cfoutput> </cfloop> <cfoutput> #thelist#
</cfoutput>
bweno Guest



Reply With Quote

