Hi all,
I'm doing a little experimentation with getting table & field information 
from Access using some code Brendan Avery posted (RE: SQL for grabbing list 
of tables in DB / fields in table?). My intention is to use this 
information to further automate the creation of administration systems.

Anyway, I've got it sussed to the point of being able to get the table 
names, field names, types, sizes, wether they are required etc, however the 
types are defined as an integer which is identified by a DAO constant.

Now, I know nothing really about this whole COM business, I used "Object 
Browser" in access and found DAO.DataTypeEnum holds all these constants, 
but how do I get that information into CF ?

Here is the code as it stands...

<CFOBJECT TYPE="COM" ACTION="CREATE" NAME="objAccess" 
CLASS="Access.Application">
<CFSET objDBEngine=objAccess.DBEngine>
<CFSET 
objDatabase=objDBEngine.OpenDatabase("d:\jobs\web-fusion\Dist_demonstrator_client\_database\ECommerce.mdb")>
<CFSET objTableDefs=objDatabase.TableDefs>

<CFLOOP COLLECTION="#objTableDefs#" ITEM="tableDef">
<CFOUTPUT>
<H3>#tableDef.Name#</H3>
<CFFLUSH>
<CFLOOP COLLECTION="#tableDef.Fields#" ITEM="field">
#field.Name# (#field.Type#, #field.Size#, #field.Required#)<BR>
<CFFLUSH>
</CFLOOP>
</CFOUTPUT>
</CFLOOP>

Anybody here a COM guru :-)


______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to