Have you seen SQLGen?  It's a cool program that does just what you're
talking about.

http://aloha-webdesign.com/

click the "SQLgen 2.0 Release" link

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may 
have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: James Sleeman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 29, 2002 1:26 PM
To: CF-Talk
Subject: little OT, getting DataTypeEnum from DAO


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_demonstr
ator_c
lient\_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 :-)



______________________________________________________________________
Why Share?
  Dedicated Win 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=coldfusionc
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