日期:2014-05-17  浏览次数:20731 次

为什么刷新一下数据就没了,要过一段时间再刷新才又有数据
请教
第一次能正常显示,为什么刷新一下数据就没了,要过一段时间再刷新才又有数据
代码如下:
sub   ShowCount()  
dim   sql,irs,strShow
dim   conn
dim   connstr
db= "WryData.mdb "   '数据库文件位置
on   error   resume   next
connstr= "DBQ= "+server.mappath( " "&db& " ")+ ";DefaultDir=;DRIVER={Microsoft   Access   Driver   (*.mdb)}; "
set   conn=server.createobject( "ADODB.CONNECTION ")
if   err   then
err.clear
else
conn.open   connstr
end   if
sql= "select   CountryName,ClickCount   from   country   order   by   ckCount   desc "
Set   irs=conn.Execute(sql)
strShow   =   " <table> "
If   irs.eof   And   irs.bof   Then  
strShow=   strShow   &   "暂无任何统计信息 "
Else
Do   While   Not   irs.eof
strShow=   strShow   & " <tr> <td   width=400> "   &   irs( "CountryName ")   & " </td> <td   width=100> "   &   irs( "ClickCount ")   &   " </td> </tr> "
irs.movenext  
Loop
End   If  
strShow   =   strShow   &   " </table> "
irs.close  
Set   irs=nothing  
Set   conn=Nothing  
response.write   strShow
End   sub

------解决方案--------------------
数据没了 是什么意思?是指显示出来的是一片空白,还是显示“暂无任何统计信息”?
------解决方案--------------------
建议及时释放对像,
还有数据库是有一定时间才反应过来没错。我也试过。