![]() |
| Need Connection Help |
|
rhkennerly
|
DW CS3 & CF 7, IIS, ODBC running locally on testing server.
CF7, ISS & ODBC running on HMS I've been away from CF for awhile and I'm trying to get my first HMS CF site set up. Local testing site is working well. My problem is how to get the db connection info onto the leased HMS site (no cf admin). I have defined an ODBC DSN on the production site, but locally CF wants to use it's own connection info. I don't seem to be able to force an ODBC connection locally, which would, of course, write a file to the connection folder, which I could then upload. I don't see connection information written into the page. I could write a DSN-less connection, as the relative url to the access db is the same on both sites, but I don't find a way to make DW/CF tolerate that locally. A lot's changed since I ran off to asp/aspx land, I guess this is my punishment A lot of the interface is just not working the way I've become used to or remember it working. Help files are not useful here. What are you guys doing here? Rick |
||||||||||||
|
|
|||||||||||||
|
tedjtw
|
First contact HMS support to be sure the ODBC DSN is set. If necessary get the database name, user name, and database password.
Setup an Application.cfm page in the root of your web site. Create a variable (IE:DBmyconnection) for 1) the DSN 2) The user name 3) the password. In each of your pages reference the variables in your CFQuery tag. Sample Application.CFM <CFSET DSN="DBMyConnection"> <CFSET User="MyName"> <CFSET pass="MyDBPassword"> Sample CFQuery <CFQUERY NAME="MyQuery" DATASOURCE="#Variables.DSN#" DBTYPE="ODBC"> USERNAME="#Variables.user#" PASSWORD="#Variables.pass#"> select blah, blah, blah </CFQUERY> That should do it HTH |
||||||||||||
|
|
|||||||||||||
| thanks, |
|
rhkennerly
|
I'll give it a try. I appreciate your taking the time.
|
||||||||||||
|
|
|||||||||||||
| Need Connection Help |
|
||
|


