do while not rst1.EOF
Listbox3.addItem rst1.Fields("bmName"),cint(rst1.Fields("id"))
“Response.Write rst1.Fields("bmname") & rst1.Fields("id")
rst1.MoveNext
loop
end if
rst1.Close
rst1.Open "select zgsname from zgs where bmid=" & id,cnn1,1,1,adcmdtext
if rst1.RecordCount >0 then
rst1.MoveFirst
do while not rst1.EOF
Listbox4.addItem cstr(rst1.Fields("zgsname"))
rst1.MoveNext
loop
end if
rst1.Close
cnn1.close
call writerst
end if
end function
………………
'凭证记帐
sub button2_onclick
dim s
s=Listbox1.selectedIndex
Response.Write s
end sub
sub listbox3_onchange
dim id,i
i=Listbox4.getCount()
do while i>-1
call Listbox4.removeItem(i)
i=i-1
loop
id=listbox3.getValue (listbox3.selectedIndex)
set cnn2=server.CreateObject("adodb.connection")
set rst2=server.CreateObject("adodb.recordset")
cnn2.CursorLocation=3
cnn2.ConnectionTimeout =30
cnn2.Open"DSN=jky"
rst2.Open "select zgsName from zgs where bmid=" & id,cnn2,1,1,adcmdtext
if rst2.RecordCount >0 then
RST2.MoveFirst
do while not rst2.EOF
Listbox4.addItem cstr(rst2.Fields("zgsName"))
rst2.MoveNext
loop
end if
rst2.Close
cnn2.Close
end sub
sub button2_onclick
set cnn5=server.CreateObject("adodb.connection")
cnn5.CursorLocation=3
cnn5.ConnectionTimeout =30
cnn5.Open"DSN=jky"
cnn5.Execute "insert into jzpz(bm,zgs,xmz,xm,sr,zc,szfx,szxs,rq,jbr,lrr,szsm) select bm,zgs,xmz,xm,sr,zc,szfx,szxs,rq,jbr,
lrr,szsm from wjzpz where lrr=“" & session("username") & "“"
cnn5.Execute "delete from wjzpz where lrr=“" & session("username") & "“"
end sub
3.数据查询(分级权限控制)
以凭证的字段为条件进行查询,在供选条件前有一方框供打“√”,其中“部门“条件必选(程序自动加上),部门内容由程序根据用户的权限自动
从数据库中调用相应值,分公司内容根据所属部门自动调整,部分程序如下:
……………
'根据权限值进入相应的查询界面
……………
function thisPage_onenter()
set cnn1=server.CreateObject("adodb.connection")
set rst1=server.CreateObject("adodb.recordset")
cnn1.CursorLocation=3
cnn1.ConnectionTimeout =30
cnn1.Open "dsn=jky"
select case session("Tright")
case "3"“副院长
rst1.Open "select bm.bmName from jk_user ,bm where JK_user.bmid=bm.id and jk_user.username =“"& session("username")