Tramite pagina asp devo effettuare un update multiplo in un data base access e succede che ci si va ad inserire solo l'ultimo valore : questo è l'elenco dei valori da inserire per l'aggiornamento:
1.582
1.744
1.888
1.936
1.955
1.982
2.001
2.019
2.037
2.055
2.069
2.085
e nella tabella access come risultato trovo:
2085
2085
2085
2085
2085
2085
2085
2085
2085
2085
2085
2085
questo è il codice della pagina asp:
<%
On Error Resume Next
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.bof.fi/Stats/default.aspx?r=/tilastot/markkina-_ja_hallinnolliset_korot/euribor_korot_today_en&Type=XML", False
If Not(Err.Number <> 0) Then
xml.Send
risultato = xml.responseText
' Response.Write(risultato)
End If
Set xml = Nothing
'http://forum.webmasterpoint.net/showthread.php?p=58086
origine=server.mappath("dati.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile (origine)
Set OggFile = fso.GetFile (origine)
Set OggTextStream = OggFile.OpenAsTextStream(2)
OggTextStream.WriteLine risultato
OggTextStream.close
nomefile = "dati.xml"
'connessione al file dati.xml
Set objXMLDom = Server.CreateObject("Microsoft.XMLDOM")
objXMLDom.load(Server.MapPath(nomefile))
'************************************************* *********
Set id = objXMLDom.getElementsByTagName("Cell")
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&_
server.MapPath("preventivo.mdb")&";PWD=tananna"
if err.Number = 0 then
Response.write "Connessione riuscita"&"
"
else
Response.write "Connessione non riuscita"&"
"
end if
Dim objRs
Set objRs = Conn.Execute("SELECT valore from _eur")
Do while NOT objRs.EOF
response.write "vecchio valore = " & objRs("valore") & "
"
objRs.Movenext
Loop
objRs.Close
Set objRs =Nothing
Response.Write "
"
For i = 3 To id.length-16
nome_attributo = id(i*2).getAttribute("txtb_value")
response.Write "nuovo valore="&nome_attributo&"
"
set objRs1 = Conn.Execute("UPDATE _eur SET valore='"&nome_attributo&"'")
Next
%>
qualcuno può aiutarmi a capire cosa non va? Grazie anticipatamente della collaborazione

Rispondi quotando