Hi,
I have inherited a funky asp/access 'desktop inventory' system for a large hospital. I am attempting to display a 'techName' field with the following code:
<%
dim techName
strSql = "SELECT tblSecurity2.fldRealName, tblSecurity2.fldSecurityID FROM tblSecurity2 WHERE ((tblSecurity2.fldSecurityID)=" & techNamekey & ");"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, DataConn
if Not rs.EOF then
techName = rs("tblSecurity2.fldRealName")
end if
rs.close
set rs = nothing
Response.Write "<strong>" & dateAdded & " @ " & timeAdded & " by " & techName & "</strong>"
%>
The strSql string prints out fine with a response.write command.
Similar statements compile and execute with no problem, such as:
'****** Computer Information Icon *******
strSql = "SELECT tblPCHistory.fldPC_ID, tblPCHistory.fldPCHistoryStatus, tblPCHistory.fldDateAdded, tblPCHistory.fldTimeAdded FROM tblPCHistory WHERE ((tblPCHistory.fldPC_ID)=" & fldPC_ID & ") ORDER BY tblPCHistory.fldDateAdded DESC , tblPCHistory.fldTimeAdded DESC;"
strPCIcon = "information.png"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, DataConn
if Not rs.EOF then
strPCPassFail = rs("fldPCHistoryStatus")
if strPCPassFail = "Pass" then strPCIcon = "information_green.png"
if strPCPassFail = "Fail" then strPCIcon = "information_red.png"
end if
rs.close
set rs = nothing
The error points to the 'techName = rs(("tblSecurity2.fldRealName") line.
ADODB.Recordset error '800a0cc1'
Unknown runtime error
/inventory/datamain.asp, line 977
I have placed the code in different sections to eliminate scope issues. The table is a stand-alone copy that has no dependencies. The other variables in the Response.Write line display fine since they are assigned from a different dataset.
Any clue?
Thanks for your time.