Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to get the dbf table's Field Name and Field Type and Field Size In CF?

New Here ,
May 31, 2007 May 31, 2007
I have use DSN to connect to the dbf table,now i want to use the <cfoutput> to show the dbf table's field name、field type and field size,how to use CF to do this.
Thanks.
TOPICS
Database access
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 01, 2007 Jun 01, 2007
Depends on the database. Some expose the schema information; others are hard to extract.

Is the DB FoxPro? dBASE? DBC or free-table?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 01, 2007 Jun 01, 2007
On Microsoft SQL server you can use the INFORMATION_SCHEMA objects to get information about the objects in a database. The attached sample describes the columns in MyTable.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2007 Jun 02, 2007
Thank you,philh.

It's the Foxpro free-table.
I have use the method query.GetMetaData().GetColumnTypeName() to get the field type,
but the method query.GetMetaData().getColumnDisplaySize() can't run in CF MX 7,however, it can get the correct result in BlueDragon 7.0.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 03, 2007 Jun 03, 2007
From my reading, it's apparent that there are no good built-in methods in either ODBC or OLEDB to get this info from Fox tables. Free tables would be even more difficult because of the lack of a defining container.

One thing to try is to write a Fox program that returns info from the AFIELDS() function. You can compile this program and place it in the system directory, and the Fox ODBC driver will treat it just like a built-in function so you can use it in CFQUERY statements.

Google "Foxpro ODBC AFIELDS()" for some ideas.

Good luck!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2007 Jun 03, 2007
thanks philh .
In BlueDragon 7,getColumnDisplaySize() can get the field size,but in CF7 or CF8 trial,I can not .
I hope to get a better method to get the field size except AFIELDS().

thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2007 Jul 05, 2007
LATEST
can you help me?thans.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources