永发信息网

asp 查询功能,response.write出数据库内的值后如何转换成中文显示

答案:2  悬赏:10  手机版
解决时间 2021-01-25 03:18
  • 提问者网友:心牵心
  • 2021-01-24 10:59
页面显示:response.write "<td align='center' width='10%' height='27' >"& crn_type &" </td>"
response.write "<td align='center' width='10%' height='27' >"& crn &" </td>"
response.write "<td align='center' width='10%' height='27' >"& p_activity &" </td>"
response.write "<td align='center' width='10%' height='27' >"& p_lst_tx_date &" </td>"
response.write "<td align='center' width='20%' height='27' >"& p_activity &" </td>"
response.write "<td align='center' width='20%' height='27' >"& activity &" </td>"
response.write "<td align='center' width='20%' height='27' >"& lst_tx_date &" </td>"
response.write "<td align='center' width='10%' height='27' >"& remark &" </td>"
其中p_activity 的值是Y,N,D
我想这样显示,如果p_activity 值是Y,网页查询出的结果不显示Y而显示“上报出勤”之类的中文意思。怎样改?
<tr align='center' valign='middle' onMouseOver="this.bgColor='#FFF1B1'" onMouseOut="this.bgColor='#B8E9D6'" bgcolor=#B8E9D6 >
<%
if crn_type="TL" then
crn_type_zw="机"
else if crn_type="SL" then
crn_type_zw="吊"
else if crn_type="PR" then
crn_type_zw="岸"
else if crn_type="TR" then
crn_type_zw="门"
else if crn_type="TK" then
crn_type_zw="车"
end if
response.write "<td align='center' width='10%' height='27' >"& crn_type_zw &" </td>"

response.write "<td align='center' width='10%' height='27' >"& crn &" </td>"
response.write "<td align='center' width='10%' height='27' >"& p_activity &" </td>"
response.write "<td align='center' width='10%' height='27' >"& p_lst_tx_date &" </td>"

页面报错,显示不了
最佳答案
  • 五星知识达人网友:人间朝暮
  • 2021-01-24 12:05
作个判断就行

<%
if p_activity = "Y" then
p_activity_wz = "上报出勤"

else
p_activity_wz = "未出勤"

end if

%>>
response.write "<td align='center' width='10%' height='27' >"& p_activity_wz &" </td>"
全部回答
  • 1楼网友:持酒劝斜阳
  • 2021-01-24 12:35
楼上正解 <% if p_activity = "Y" then p_activity_wz = "上报出勤" else if p_activity = "N" then ........ else ........ end if %>> response.write "<td align='center' width='10%' height='27' >"& p_activity_wz &" </td>"
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯