asp中如何操作access数据库字段相加结合然后显示在网页上 表为 ID yintao juzi shucai apli 1 2 3 2 2

2024-11-21 21:23:57
推荐回答(1个)
回答1:

<%
Set MRs=server.CreateObject("adodb.recordset")
MRs.open"select ID,yintao,juzi,shucai,apli from [表名] order by ID asc",conn,3,1
if Not MRs.Eof then
Response.Write "

"
Response.Write ""
For I=1 To MRs.RecordCount
StrID=MRs("ID")
StrYintao=MRs("yintao")
StrJuzi=MRs("juzi")
StrShucai=MRs("shucai")
StrApli=MRs("apli")
StrCount=StrYintao+StrJuzi+StrShucai+StrApli
Response.Write ""
MRs.MoveNext
If MRs.Eof Then Exit For
Next
Response.Write "
IDYintaoJuziShucaiapliCount
"&StrID&""&StrYintao&""&StrJuzi&""&StrShucai&""&StrApli&""&StrCount&"
"
end if
MRs.close
Set MRs=nothing
%>