Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display table properties via CF?

Status
Not open for further replies.

loezy

Programmer
Mar 31, 2003
5
US
I'm modifying the structure of an Access table using SQL and ColdFusion. I want to be able to verify my results so that I can be sure that I made the changes correctly. How can I display a list of fields, data types, indexes, keys, etc., using ColdFusion and/or SQL?
 
you could have a look at this custom tag:


if this link doesn't work then have a look on the CF exchange for a tag called CF_DBINFO

it allows you to see what tables are in your database.

to find out what fields are within each table you can output the column list from a query like so:

<cfquery .... name=&quot;thisquery&quot;>
select *
from yourtable

<cfoutput>
#thisquery.columnlist#
</cfoutput>

as for outputting all of the indexes, data types etc, I don't think that this is possible with Access (might be wrong though), as using the &quot;describe&quot; command throws an error on my system (WinXP, Access, CFMX)

<cfquery ....
describe yourtable

hope this helps!

Tony
 
I think you're on the right track. Maybe I'll try implementing this script later today or tomorrow. Or maybe not. I wanted to verify that my changes were correct, but they're probably fine.

I was really hoping that there was something simple like the Describe function. Do you know what other databases allow Describe?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top