Zealus.com wrote:
> Hi all,
> first let me say that I am no CF developer, so some
concepts might escape me.
>
> I've got a pretty old ColdFusion 6 application on my
hands that I need to
> migrate to MX 7 version. The application is
dual-language web store that uses
> mySQL on the backend.
>
> As far as I understand the connection to the DB is made
via ODBC.
> Being not quite familiar with CF I am confused between
several ways the
> application is talking to DB. So far I see:
>
>
> What's the difference? What is the correct way?
>
> <cfquery datasource="data_source" dbtype="ODBC">
> INSERT INTO Users (CFID, Date) VALUES
('#client.cftoken#',
> '#DateFormat(Now(),"YYYY-MM-DD")#')
> </cfquery>
>
> <cfquery datasource = "data_source" name =
"getToken">
> SELECT CFID, Language FROM Users WHERE UserID =
#getUser.LastUser#
> </cfquery>
>
> <cfquery name="rsCategory"
datasource="data_source">
> SELECT CategoryID, Category, Category_Rus FROM
Categories ORDER BY
> CategoryID ASC
> </cfquery>
>
They are all correct accept the dbtype="ODBC". That parameter
was
deprecated in version CFMX (version 6) accept for a value of
'query'
which is used to use <cfquery...> tags and SQL code to
combine two
record sets that are already in memory. As of this time, the
value of
'ODBC' is probably just ignored, but the documentation does
warn that
using values other then 'query' may cause errors in the
future.
Previous to CFMX (version 6) one could provide the complete
database
connection detsails (dbName, dbServer, provider, providerDSN,
dbType) in
the <cfquery...> tag. Thus not requiring DSN
configuration details set
in the ColdFusion administrator. This is no longer true.