Ho cercato il modo di inserire un file txt sul forum e ne ho trovato uno che funziona abbastanza bene, ho provato a sistemarlo un po' et ci sono dei problemi dato che io ho più righe e mi prende solo l'ultima.
Qualcuno sa come posso risolvere questo problema?
codice:<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <% set Inserisci=Server.CreateObject("ADODB.Command") Inserisci.ACTIVECONNECTION=MM_Conn_Sassa_STRING file = server.mapPath("prova.txt") set fso = server.createObject("scripting.fileSystemObject") if fso.fileExists(file) then set file = fso.openTextFile(file) i = 1 while not file.atEndOfStream if i > 1 then tempLine = file.readLine tempLine = replace(tempLine,"""","") elTempLine = split(tempLine,";") Inserisci.CommandText=("INSERT INTO prova (Riferimento) VALUES('" & elTempLine(0) & "')") end if i = i + 1 wend set file = nothing end if Inserisci.execute set fso = nothing %> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Documento senza titolo</title> </head> <body> Prova</p> Indietro</p> </body> </html>

Rispondi quotando
