急救!急救!
我有两个表ipacl表 和ip表
ipacl是我存放ip地址 如127.0.0.1
ip表是一个ip库 ip段到ip段. 什么国家. 什么网络
我下面的代码是
循环读取ipacl的ip地址 转换成跟ip库一样的数字..在跟ip表做比较.判断这个IP是那个国家
现在出错:
ADODB.Field (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
出错的行数..提示是 98行
98 kkk = rs1( "addj ")
高手帮我解决下!
<%
Dim totalNum,imgWidth,hourPercent,ct,aripadad,aripc,index,sq,rs1,kkk, kk
sqls = "select ipaddr,count(*) as ipc from ipacl GROUP BY ipaddr "
Set rs = server.CreateObject( "ADODB.recordset ")
rs.open sqls,conn,1,1
Do While Not rs.eof
totalNum = totalNum + rs( "ipc ")
rs.movenext
Loop
rs.movefirst
Do While Not rs.eof
myarray = cip(rs( "ipaddr "))
imgWidth=formatnumber(rs( "ipc ")/totalNum,2)*500
hourPercent=formatnumber(rs( "ipc ")/totalNum,4)*100
%>
<tr>
<td height= "20 " valign= "bottom " bgcolor= "#FFFFFF "> <div align= "center "> <%=rs( "ipaddr ")%> </div> </td>
<td valign= "bottom " bgcolor= "#FFFFFF "> <div align= "center "> <%=rs( "ipc ")%> </div> </td>
<td valign= "bottom " bgcolor= "#FFFFFF "> <div align= "left ">
<img src= "images/green.gif " width= " <%=imgWidth%> " height= "10 " /> <%=rs( "ipc ")%> : <%=hourPercent%> % </div> </td>
<%
sq = "select addj from ip where onip <= "&myarray& " and offip > = "&myarray& " "
Set rs1 = server.CreateObject( "adodb.recordset ")
rs1.open sq,conn,1,1
kkk = rs1( "addj ")
%>
<td valign= "bottom " bgcolor= "#FFFFFF "> <div align= "center "> <%=kkk%> </div> </td>
<%
rs.movenext
Loop
rs.close
Set rs = nothing
%>
</tr>
------解决方案--------------------加个判断
if not(rs.bof and eof) then
------解决方案--------------------if not rs1.eof then
kkk = rs1( "addj ")
else
kkk = "未知 "
end if