<%

dim ydzqconn
set ydzqconn=Createobject("ADODB.Connection")
ydzqconn.ConnectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/vote/saytk_vote")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
ydzqconn.open
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 * from YD_info order by id desc",ydzqconn,1,1
if not rs.eof then
qinum=rs("qinum")
newtm=rs("tm")
newpm1=rs("pm1")
newpm2=rs("pm2")
newpm3=rs("pm3")
newpm4=rs("pm4")
newpm5=rs("pm5")
newpm6=rs("pm6")

jietime=rs("jietime")
tznum=rs("tznum")
jbnum=rs("jbnum")
end if
rs.close
set rs=nothing
set rsadmin=Server.CreateObject("ADODB.Recordset")
rsadmin.open"select voteAdmin from YD_all where id=1",ydzqconn,1,1
if not rsadmin.eof then
voteAdmin="1,"&rsadmin("voteAdmin")'管理员ID1为默认管理员
end if
rsadmin.close
set rsadmin=nothing

Function date_vote(fordatenum)
Dim aa,bb,cc,dd,ee,ff,gg 
aa=DateDiff("s",now(),fordatenum) 
bb=Int(aa/86400) 
cc=aa-bb*86400 
dd=Int(cc/3600)
ee=cc-dd*3600 
ff=Int(ee/60)
gg=ee-ff*60 
Response.write "距离开奖时间还有" 
if bb>0 then Response.write bb&"天" 
if bb>0 or dd>0 then Response.write dd&"小时" 
if bb>0 or dd>0 or ff>0 then Response.write ff&"分" 
if bb>0 or dd>0 or ff>0 or gg>0 then Response.write gg&"秒" 
end Function
%>