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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access data types

Status
Not open for further replies.

twcman

Programmer
Joined
Jun 28, 2001
Messages
284
Location
US
I am using the following code to find the fields within a database in access:

<cfquery name=&quot;test&quot; datasource=&quot;#datasource#&quot; dbtype=&quot;ODBC&quot;>
Select *
From coordinatortbl
</cfquery>
<cfloop index=&quot;FormFieldName&quot; list=&quot;#test.columnlist#&quot;>

<cfoutput>
#FormFieldName#<br>
</cfoutput>
</cfloop>

could some one tell me how to find the data types of these fields. I found how to do it in sql and I do not think the information is in the msys tables hidden within the database.
 
Hello,
I found the answer between some tips I have.

<cfquery name=&quot;myQuery&quot;>
select * from tablename
</cfquery>

<cfloop index=&quot;ColumnName&quot; list=&quot;#myQuery.ColumnList#&quot;>
<cfset ColumnValue = Evaluate(&quot;#ColumnName#&quot;)>
<cfoutput>
#ColumnName#=#ColumnValue#<br>
</cfoutput>
</cfloop>
 
thanks for the help but when I enter the code, it generates the following error:

Error Occurred While Processing Request
Error Diagnostic Information

An error occurred while evaluating the expression:


ColumnValue = Evaluate(#ColumnName#)



Error near line 30, column 7.



I tried moving the cfoutput to before the cfset statement but no soap. Still the same error.

Any suggestions?
BTW I am trying to use this on an Access database.
 
OK, I had a look and mad a few changes. I assume that you have the source set. Take out the CFset evaluate part and remove the #columnvalue# You should now get a list of the column names.
 
When I do that I am back to the code from my original post. I am looking for the data type of the field not just the field name.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top