Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create ODBC connection from CF dynamically

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm trying to import an access file via a form on a web page, and then copy all of the records in the file to a SQL 7 table.

I know i have to follow three steps:

1. CFFILE puts the access file in the server dir.
2. Create an ODBC connection to it with CF dynamically.
3. Run a query against it CFOUTPUT loop through the query.
For each record in the query, insert a record into the SQL database. Remove the ODBC connection and the file. (depending on whether or not they will be needed later)

The only thing I don't know is the possibility to create the ODBC connection from CF dynamically.(the second step)

I appreciate any ideas on how to do this?
 
You havent mentioned what version of CF you are using. Cold Fusion 5 gives functionality to create dynamic ODBC connections using something like this :
<CFQUERY
DBTYPE=&quot;dynamic&quot;
CONNECTSTRING=&quot;DRIVER=Microsoft Access Driver (*.mdb);
DBQ=C:\CFusion\Database\cfsnippets.mdb;DriverId=281;
FIL=MS Access;MaxBufferSize=2048;PageTimeout=5&quot;>

Hope this helps.
Gana
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top