I was asked to look at some code written in ColdFusion which I've had very little exposure to and haven't seen since the 90s and some of it is not clear and I'm sure it's basic.
I got past one error because of a typo in a variable name. Now, another part of the code is erroring out as I put in the title:
variable DTRAN is undefined.
One common page uses a switch, based up on the menu to call for that item, so the error returns referencing that page: sshAdmin.cfm, but the pages in question are export.cfm and export_do.cfm
export.cfm
<cfcase value="xpr">
<tr><td class="darkRow" colspan="2" align="center">Back to <b><a href="sshadmin.cfm?adm=xpr" class="darkLinks">Main Export Menu</a></b></td></tr>
<cfoutput><tr><td class="textRow"><a href="sshadmin.cfm?adm=xpr&xpr=xpr&xp=all&tID=#tID#" class="textRow">Export <b>ALL</b></a></td><td class="textRow"><a href="sshadmin.cfm?adm=xpr&xpr=xpr&xp=new&tID=#tID#" class="textRow">Export <b>NEW</b></a></td></tr></cfoutput>
<tr><td class="ltGroupRow">Date Ran</td><td class="ltGroupRow"># Of Records</td></tr>
<cfoutput query="cfspExport">
<tr><td class="textRow">#DateFormat(dtRan, "mm/dd/yyyy")# #TimeFormat(dtRan, "hh:mm tt")#</td><td class="textRow">#intRecords#</td></tr>
</cfoutput>
</cfcase>
export_do.cfm
<cfmail from="#REQUEST.mailFrom#" server="#REQUEST.mailServer#" username="#REQUEST.mailUN#" password="#REQUEST.mailPW#" subject="New SSH Export" to="#sAdminEmail#" query="cfspExportInfo" mimeattach="#sDir##sFileName#">Hello!
Export Type: #vcExportType#
Run Time : #DateFormat(dtRan, "mm/dd/yyyy")# #TimeFormat(dtRan, "hh:mm tt")#
Records : #intRecords#
Text file is attached. Images and text file available via FTP
</cfmail>
From what I'm told, all this worked at some point but when I found a variable was spelled incorrectly, with the first error I was getting, I'm concerned. This site was moved and this part has not been looked at in years and I was told by the original developer, who has abandoned it, that he did make some changes to make it work with the new host.
From what I' ve looked at, I don't know if I need a CFPARAM to define it of it I'm missing a file or there is a path issue where the page I need resides. I can run the stored procedure in SQL adding the values passed, and that completes successfully so it appears it's something basic. I don't know if I've given enough information and any help is appreciated.