How do I call a recordset field with the JS in CFScript? I tried oRs.Fields["RowName"].value but it didn't work? Any help? My code is below ...
<CFOBJECT TYPE="COM"
ACTION="CREATE"
CLASS="ADODB.Connection"
NAME="oConn">
<CFOBJECT TYPE="COM"
ACTION="CREATE"
CLASS="ADODB.Recordset"
NAME="oRs">
<cfscript>
DSNTxt = "DRIVER={Microsoft Text Driver (*.txt; *.csv)};HDR=Yes;Persist Security Info=False;DBQ=" & #ExpandPath("./upload/"#;
WriteOutput("DSNTxt: " & DSNTxt & "<br>"
strSQL = "select * from " & URL.FileName;
WriteOutput("SQL: " & strSQL & "<br><br>"
oConn.Open ("#DSNTxt#","","",-1);
oRs.Open (strSQL, oConn, 1,1,1);
while (not oRs.EOF) {
WriteOutPut(oRs.Fields["FieldName"].value);
oRs.MoveNext();
}
oRs.Close();
oConn.Close();
<CFOBJECT TYPE="COM"
ACTION="CREATE"
CLASS="ADODB.Connection"
NAME="oConn">
<CFOBJECT TYPE="COM"
ACTION="CREATE"
CLASS="ADODB.Recordset"
NAME="oRs">
<cfscript>
DSNTxt = "DRIVER={Microsoft Text Driver (*.txt; *.csv)};HDR=Yes;Persist Security Info=False;DBQ=" & #ExpandPath("./upload/"#;
WriteOutput("DSNTxt: " & DSNTxt & "<br>"
strSQL = "select * from " & URL.FileName;
WriteOutput("SQL: " & strSQL & "<br><br>"
oConn.Open ("#DSNTxt#","","",-1);
oRs.Open (strSQL, oConn, 1,1,1);
while (not oRs.EOF) {
WriteOutPut(oRs.Fields["FieldName"].value);
oRs.MoveNext();
}
oRs.Close();
oConn.Close();