Avrei fatto così:
codice:
Set RS = Server.CreateObject("ADODB.Recordset")
sql = " select VisitorIP from tbl_sessioni where VisitProven = ''"
RS.Open sql, objConn, 3, 3
Do While NOT RS.EOF
IP_Address = RS("VisitorIP")
response.write ip_address &"
"
number_ip = split(IP_Address, ".")
A = number_ip(0)
B = number_ip(1)
C = number_ip(2)
D = number_ip(3)
E = A * (256*256*256)
F = B * (256*256)
G = C * (256)
H = D
IP_Number = (E + F + G + H)
response.write ip_number &"
"
Set oRS = objConn.Execute("SELECT * FROM tbl_ip WHERE IP_FROM <= "& IP_Number &" and IP_TO >= "& IP_Number &"")
IPAdd = oRS.Fields("COUNTRY_NAME")
sql = "update tbl_sessioni set Visitproven = '"& IPAdd &"' where VisitProven IS NULL"
objConn.Execute(sql)
RS.MoveNext
Loop
rs.Close
set rs = Nothing
objConn.Close
set objConn = Nothing
Errore sulla riga rossa:
Tipo di errore:
ADODB.Field (0x800A0BCD)
Il record corrente corrisponde all'inizio o alla fine del file oppure è stato eliminato. Per eseguire l'operazione richiesta è necessario disporre di un record corrente.