Yes it looks a lot like ASP b/c it's using an ADO (ActiveX Data Object? - I
never remember that TLA... it's a COM object by another name) which is what ASP
commonly uses. So you are using the same object, and the syntax looks
superficially similar... but it is very much CF: You could do the same tag based
if you desired (though it would be much harder to read IMO). Bear in mind though
that accessing dbs in this way is much slower in both dev time and execution
time (in almost all cases) than using CFs native functions such as CFQUERY,
CFSTOREDPROC, etc.

   I very rarely use M$ Access so if you have a better solution for retrieving
field design info from that dbms (I use the term loosely) then I'm all ears
(well... eyes).  ;)

  So while it looks a lot like ASP, it is actually CFSCRIPT code.


P.S.  I'd also like to ask: When using an OLEDB connection to Access instead of
ODBC there are certain functions you can perform b/c of the interface? I'm not
much into the NT environ but, I've heard that Access dbs perform much better
under an OLEDB connection and that there is a command set that's part of the
interface?

-----Original Message-----
From: Warrick, Mark [mailto:[EMAIL PROTECTED]]
Sent: January 18, 2001 22:13
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: ASP Code within CF Code? WAS (RE: retreiving datatypes)


That looks an awful lot like ASP code.  Are you saying it's possible to run
ASP-like code within CF templates?

---mark

--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Fax: (714) 972-2181
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------


> -----Original Message-----
> From: Raymond B. [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 17, 2001 7:25 PM
> To: CF-Talk
> Subject: RE: retreiving datatypes
>
>
> Unlike most dbms's Access doesn't have the system tables that allow you to
> retrieve table and field info though SQL statements; to my knowledge (I
> avoid Access like the plague so there may be easier ways than
> what follows).
>
> Under win you can the ADODB.Connection class object and retrieve them this
> way (where dsn, username, pass are vars):
>
>       <cfscript>
>       // initalise the DB object and open a connection to the desired db
>       dbo = createObject("COM", "ADODB.Connection") ;
>       dbo.Open("DSN=" & dsn, username, password, -1) ;
>
>       // get schema (schema 4 is field info, 20 table info) recordset
>       recordset = dbo.OpenSchema(4) ;
>       // assign fields to "Fields" collection from returned schema
>       fields = recordset.Fields ;
>
>       ...
>
> The fields collection contains all the info you'll need, and can
> be accessed
> like this:
>
>       table_name = fields.Item("TABLE_NAME") ;
>       // display table current field belongs too
>       writeOutput(table_name.value) ;
>
> Other valid fields in the schema recordset are; COLUMN_NAME, DATA_TYPE,
> CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE, COLUMN_DEFAULT, COLUMN_FLAGS, etc.
>
>       // move the cursor to the next record
>       recordset.MoveNext() ;
>
> In the way above you can loop through all the data in the schema, to keep
> track of it all I'd suggest using a struct. This may lots more
> info than you
> need, but it's the only way I know to get datatypes and other design info
> from an Access table. Much, much, more difficult than simply
> querying the db
> as in other dbms's.
>
>
>
> -----Original Message-----
> From: Terry Troxel [mailto:[EMAIL PROTECTED]]
> Sent: January 17, 2001 13:33
> To: CF-Talk
> Subject: retreiving datatypes
>
>
> I know that I can build a list of column names in an Accrss table with the
> columnlist variable, but is there also a way I can do the same thing in
> order to retrieve the corresponding datatypes for all the fields in an
> Access table?
>
> Terry Troxel
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to