|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
How connect my project
have folder tom on another machine and I'd like to move in my server.
I created CF data source name = raf I tried with url but I get this error (after connection): Error Executing Database Query. Data source not found. The error occurred in E:\Inetpub\wwwroot\tom\afmlogincheck.cfm: line 31 29 : SELECT 1 FROM afm_users 30 : WHERE user_name = {fn UCASE( '#AfmUName#' )} 31 : AND user_pwd = {fn UCASE( '#AfmPWord#' )} 32 : </cfquery> 33 : This is my afmlogincheck.cfm [CODE] <CFQUERY NAME="test_AfmUName" DATASOURCE = "#Cookie.AFMDSN#" > SELECT 1 FROM afm_users WHERE user_name = {fn UCASE( '#AfmUName#' )} AND user_pwd = {fn UCASE( '#AfmPWord#' )} </cfquery> <body> <TABLE> <tr><td><a href="/afm/afm_hotlist.cfm"> <IMAGE SRC="/afm/afminet.gif" ALT="ARCHIBUS/FM" ALIGN="CENTER" BORDER="0"></a></td> <td colspan=3 ALIGN=LEFT> <Font face="Arial" size="+2"> <b>ARCHIBUS/FM Web Central Login validation</b></FONT> </td> </tr> </TABLE> <CFIF #test_AfmUName.RecordCount# LT 1> <CFLOCATION url="afmLogin.cfm?var_invalid=true"> <CFELSE> <CFCOOKIE NAME="AfmUserName" VALUE=#AfmUName#> <CFIF IsDefined("cookie.AFM_SCRIPTNAME") IS "TRUE"> <cfoutput> <SCRIPT language="JavaScript1.2"> self.location = "#cookie.AFM_SCRIPTNAME#" </script> </cfoutput> <CFELSE> <CFLOCATION url="/afm/afm_hotlist.cfm"> </cfif> </CFIF> </body> </html> this is my application.cfm: <CFIF #IsDefined("cookie.AFMDSN")# IS "FALSE"> <CFCOOKIE NAME="AFMDSN" VALUE="wcentral"> </CFIF> <!--- Please change the value to TRUE if using Afm Security -----> <CFCOOKIE NAME="UseAfmSecurity" VALUE="TRUE"> <CFIF #Cookie.UseAfmSecurity# IS "TRUE"> <CFIF #IsDefined("cookie.AfmUserName")# IS "FALSE" OR (#cookie.AfmUserName# IS "") > <CFIF #IsDefined( "AfmUName" )# IS "FALSE"> <CFIF (CGI.SCRIPT_NAME IS NOT "/afm/afmLogin.cfm") AND (CGI.SCRIPT_NAME IS NOT "/afm/AfmLoginCheck.cfm") AND (CGI.SCRIPT_NAME IS NOT "/afm/reports/projectchooser.cfm") AND (CGI.SCRIPT_NAME IS NOT "/afm/reports/projectset.cfm")> <CFCOOKIE name="AFM_SCRIPTNAME" value="#CGI.SCRIPT_NAME#"> <SCRIPT language="JavaScript1.2"> self.location = "/afm/AfmLogin.cfm" </script> </CFIF> </CFIF> </CFIF> </CFIF> <!--- Please change the value to TRUE for international version -----> <CFCOOKIE NAME="UseInternationalDates" VALUE="FALSE"> <CFIF #Cookie.UseInternationalDates# IS "FALSE"> <CFCOOKIE NAME="DateSeperator" Value="/"> <CFCOOKIE NAME="AFMDateFormat" VALUE="mm/dd/yyyy"> <CFCOOKIE NAME="AFMDateType" VALUE="0"> <CFCOOKIE NAME="AFMTimeFormat" VALUE="hh:mm:sstt"> <cfelse> <!--- Please change the value of seperator (i.e. "." ) for international version if necessary-----> <CFCOOKIE NAME="DateSeperator" Value="-"> <!--- Please change the value for international version if necessary-----> <CFCOOKIE NAME="AFMDateFormat" VALUE="dd-mm-yyyy"> <!--- Please change the value for international version if necessary-----> <CFCOOKIE NAME="AFMDateType" VALUE="1"> <!--- 0: mm/dd/yyyy; 1: dd/mm/yyyy; .....seperator does not matter----> <!--- Please change the value for international version if necessary-----> <CFCOOKIE NAME="AFMTimeFormat" VALUE="HH:mm:ss"> </cfif> <!--- Please change the value for international version if necessary-----> <!---- Set of characters that are used to show how ColdFusion should display the date: d -- Day of the month as digits with no leading zero for single-digit days. dd -- Day of the month as digits with a leading zero for single-digit days. ddd -- Day of the week as a three-letter abbreviation. dddd -- Day of the week as its full name. m -- Month as digits with no leading zero for single-digit months. mm -- Month as digits with a leading zero for single-digit months. mmm -- Month as a three-letter abbreviation. mmmm -- Month as its full name. y -- Year as last two digits with no leading zero for years less than 10. yy -- Year as last two digits with a leading zero for years less than 10. yyyy -- Year represented by four digits. -----> <CFCOOKIE NAME="AFMDATEDDDDMMMDDYYYY" VALUE="dddd, mmm dd, yyyy"> <!--- Please change the value for international version if necessary - Copy and Paste -----> <!---- Set Locale to: Dutch (Belgian) Dutch (Standard) English (Australian) English (Canadian) English (New Zealand) English (UK) English (US) French (Belgian) French (Canadian) French (Standard) French (Swiss) German (Austrian) German (Standard) German (Swiss) Italian (Standard) Italian (Swiss) Norwegian (Bokmal) Norwegian (Nynorsk) Portuguese (Brazilian) Portuguese (Standard) Spanish (Mexican) Spanish (Modern) Spanish (Standard) Swedish -----> <cfset locale = SetLocale("Italian (Standard)")> <!---- DO NOT CHANGE EXCEPT FOR DATEFORMAT----> <cffunction name="AFM_LSDateFormat"> <cfargument name="AFM_Date" required="YES"> <cfargument name="AFM_DateFormat" required="YES"> <cfif AFM_Date is not ""> <!--- Please change format (i.e. mm/dd/yyyy) to your international version -----> <cfset AFM_Date = "#DateFormat(AFM_Date, "dd/mm/yyyy")# 00:00:00"> <cfreturn LSDateFormat(AFM_Date,AFM_DateFormat)> <else> <cfreturn ""> </cfif> </cffunction> <!---- DO NOT CHANGE ----> <cffunction name="AFM_LSTimeFormat"> <cfargument name="AFM_Time" required="YES"> <cfargument name="AFM_TimeFormat" required="YES"> <cfif AFM_Time is not ""> <cfreturn LSTimeFormat(AFM_Time,AFM_TimeFormat)> <else> <cfreturn ""> </cfif> </cffunction> Which file I must modify to connect at my project tom? Have someone any idea? Thanks |
|
#2
|
|||
|
|||
|
Sorry, but unless you can pare that down to a simple example that demonstrates the problem, I can't help you. I just don't have the time to go through all that code.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Also, are you aware that storing any important data in a cookie is a massive security hole, since cookies can be simulated by hackers?
|
|
#4
|
|||
|
|||
|
Finally, what this is telling you:
Code:
Error Executing Database Query.
Data source not found.
The error occurred in E:\Inetpub\wwwroot\tom\afmlogincheck.cfm: line 31
29 : SELECT 1 FROM afm_users
30 : WHERE user_name = {fn UCASE( '#AfmUName#' )}
31 : AND user_pwd = {fn UCASE( '#AfmPWord#' )}
32 : </cfquery>
33 :
This is my afmlogincheck.cfm
[CODE]
<CFQUERY NAME="test_AfmUName" DATASOURCE = "#Cookie.AFMDSN#" >
SELECT 1 FROM afm_users
WHERE user_name = {fn UCASE( '#AfmUName#' )}
AND user_pwd = {fn UCASE( '#AfmPWord#' )}
</cfquery>
Is that whatever value is defined in Cookie.AFMDSN is not a valid ColdFusion data source name. So you need to set up a data source on the new server if that is the case. And I would strongly recommend not storing the data source name in a cookie. |
|
#5
|
|||
|
|||
|
Quote:
If I change DATASOURCE = "#Cookie.AFMDSN#" with DATASOURCE = raf in afmlogincheck.cfm run correcly but after I get new error Data source not found. How can I change DATASOURCE = "#Cookie.AFMDSN#" with a correct variabile? Thanks in advance! |
|
#6
|
|||
|
|||
|
You're missing the point: you have to set the cookie to a valid data source name or you will always get this error. Use the cfdump tag to look at the values in the cookie and you'll see that you don't have a valid data source name set.
<cfdump var="#cookie#"> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > How connect my project |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|