Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/08/2004, 14:26
Ana Alda
 
Fecha de Ingreso: julio-2004
Mensajes: 27
Antigüedad: 20 años, 9 meses
Puntos: 0
Pregunta Error al leer un archivo de texto en insertar a BD

hola a todos tengo un duda de como poder insertar mas lineas de un archivo de texto a un bd, ya que utilizo este codigo y solo me guarda las ultimas 5 lineas, espero y puedan decirme cual es el problema, gracias este es el siguiente error.

Microsoft VSScript RunTime Error 800a003e
Input Past end of file

este es el codigo

<html>
<head>
<title></title>
<SCRIPT language=Javascript>
<!-- Begin
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
// End -->
</script>
</head>
<body background="imagenes/fondo.jpg" bgcolor="#000099"oncontextmenu="return false">
<%
'llamada general al componente
Set Upload = Server.CreateObject("Persits.Upload")

'guardar el fichero usando una ruta virtual y no del sistema de ficheros.
'recuerde crear el directorio uploads (o el que ud quiera) y otorgar permisos de escritura como se explica en este documento
Count = Upload.SaveVirtual ("/AspUpload/")

Dim Obj, oConn,Sql

Set Obj = Server.CreateObject("Scripting.FileSystemObject")

Set NomArchivo = Obj.OpenTextFile(Server.MapPath(".") & "\license.txt")

NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()
NomArchivo.ReadLine()

'Conectamos a nuestra BD.
Set oConn = Server.CreateObject ("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="& Server.MapPath("/CustomersData/DataBase/AxSRegistrar.mdb")

'sentencia sql para insertar los datos
Sql="Insert Into License (CDKey,Licensor,Product,Version,Licensee,Host_Name ,OS_Name,Signature,Modulo,Expiration) values ('"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"', '"& NomArchivo.ReadLine() &"') "

oConn.Execute(Sql)

NomArchivo.Close

'Response.Redirect("correos.asp")

oConn.Close
Set oConn=Nothing

%>
</body>
</html>