Buona sera, sicuramente ho sbagliato qualcosa volevo sapere se qualcuno poteva aiutarmi.
avrei necessità di fare questo ciclo e che prosegua finchè non arriva al eof, il problema che ho è che il non prosegue nei record l'unica cosa che posso dire è che non ci sono tutti i record cioè per esempio può esserci 1,2,3,4,7,9,34,56,57,58 ecc. dove sbaglio ? grazie a tutti in anticipo
Dim str, rs, strConn, Conn, strMDBPath, varTotale, ID, contatore, stringa
contatore = 1
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[MDB];Persist Security Info=False;"
'CONNESSIONE DATABASE IpReportVirus
strMDBPath=Server.MapPath("..\..\mdb-database\*\*.mdb")
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open Replace(strConn,"[MDB]",strMDBPath)
set stringa = Conn.execute ("Select count(*) as varTotale from Tbl")
response.write "Record nel database: "&stringa("varTotale")
'ciclo per ripulire le stringhe dai caratteri non alfa numerici compresi lo spazio e il punto
'vengono sostituiti da un punto
response.write ("
")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open ("Select * from Tbl by ID"), Conn, 3
if rs.eof=false then
set ID = Conn.execute ("Select NOME as str from Tbl WHERE ID="&contatore)
set str = ID("str")
Dim Objregexp
set Objregexp = New RegExp
Objregexp.Pattern = "[^A-Za-z0-9 .\s]"
Objregexp.Global = True
Objregexp.IgnoreCase = True
str = Objregexp.Replace (str,".")
set Objregexp = Nothing
Conn.execute ("UPDATE Tbl SET NOME='"&str&"' WHERE ID="&contatore)
rs.movenext
end if
set rs = NOTHING
'Close Database
Conn.close
Set Conn=nothing

Rispondi quotando
