741
社区成员
发帖
与我相关
我的任务
分享
set oConn=CreateObject("Adodb.connection")
oConn.open "driver={SQL server};Server=syyy,uid=chis,pwd=test,database=sychisdb"
Set rs=oConn.execute("select count(*) from zy_actpatient where ward=1700300")
str= "ICU一室现在有 " & rs(0) & " 个病人!" & vbcrlf & vbcrlf
Set rs=oConn.execute("select name,sex,bed_no,balance,admiss_diag_str from zy_actpatient where ward=1700300 order by bed_no")
while not rs.eof
if rs(1)="1" then
str=str & rs(2) & trim(rs(0)) & " 男性 余额" & rs(3)&" "&rs(4) &vbcrlf & vbcrlf
else
str=str & rs(2) & trim(rs(0)) & " 女性 余额" & rs(3)&" "&rs(4) &vbcrlf & vbcrlf
end if
rs.movenext
Wend
msgbox str
Set oConn=Nothing
public
还是不太会用
好