Otra vez con otro problema.
A ver si alguien me puede decir por qué en el siguiente código me da error loop sin do .
Cita:
Lo que hace o lo que intento que haga es leertodas las lineas de un txt, sacar un nombre, compararlo en una base de datos y si no esixte, añadirlo a otra.<%
Response.Buffer = False
Server.ScriptTimeout = 9990000
Function GetText(strText, strStartTag, strEndTag)
dim intStart
intStart = instr(1, strText, strStartTag, vbtextcompare)
if intStart then
intStart = intStart + len(strStartTag)
intEnd = InStr(intStart + 1, strText, strEndTag, vbtextcompare)
GetText = Mid(strText, intStart + 1, intEnd - intStart - 1)
else
GetText = " "
end if
End Function
Dim Conexion,Tabla
Set Conexion=Server.CreateObject("adodb.connection")
Set Tabla=Server.CreateObject("adodb.recordset")
Conexion.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("/mdb-database/craw/craw.mdb")
for i = 1 to 10
strFileName2 = "/craw/cover/txt-covers/"&i&".txt"
Set objFSO2 = CreateObject("Scripting.FileSystemObject")
Set objTextFile2 = objFSO2.OpenTextFile(Server.MapPath(strFileName2))
Do While Not objTextFile2.AtEndOfStream
url = objTextFile2.ReadLine
portada=GetText (url, "php?ID", "</a>")
separacion=split(portada,""">")
id=separacion(Lbound(separacion))
nombre=separacion(Ubound(separacion))
response.write nombre &"<br>"
' controlarsilatengo
fileName = LCase(nombre)
'replace
fileName = replace(fileName,"'","''")
Set Conex=Server.CreateObject("adodb.connection")
Set Tabl=Server.CreateObject("adodb.recordset")
Conex.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("/mdb-database/music.mdb")
Tem="Select * From music Where UCase(pal) like '%" &fileName& "%' order by UCase(pal) asc"
Tabl.Open Tem, Conex,1
If Tabl.BOF And Tabl.EOF Then
nombre1 = replace(nombre,"'","''")
Temp="Select * From audio Where UCase(pal) like '%" &nombre1& "%' order by UCase(pal) asc"
Tabla.Open Temp, Conexion,1
If Tabla.BOF And Tabla.EOF Then
Tabla.AddNew
Tabla("id") = id
Tabla("cover") = nombre
Tabla.update
end if
Tabl.Close
Conex.Close
'fin controlarsilatengo
Loop
objTextFile2.Close
Set objTextFile2 = Nothing
Set objFSO2 = Nothing
next
Tabla.Close
Conexion.Close
%>
Response.Buffer = False
Server.ScriptTimeout = 9990000
Function GetText(strText, strStartTag, strEndTag)
dim intStart
intStart = instr(1, strText, strStartTag, vbtextcompare)
if intStart then
intStart = intStart + len(strStartTag)
intEnd = InStr(intStart + 1, strText, strEndTag, vbtextcompare)
GetText = Mid(strText, intStart + 1, intEnd - intStart - 1)
else
GetText = " "
end if
End Function
Dim Conexion,Tabla
Set Conexion=Server.CreateObject("adodb.connection")
Set Tabla=Server.CreateObject("adodb.recordset")
Conexion.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("/mdb-database/craw/craw.mdb")
for i = 1 to 10
strFileName2 = "/craw/cover/txt-covers/"&i&".txt"
Set objFSO2 = CreateObject("Scripting.FileSystemObject")
Set objTextFile2 = objFSO2.OpenTextFile(Server.MapPath(strFileName2))
Do While Not objTextFile2.AtEndOfStream
url = objTextFile2.ReadLine
portada=GetText (url, "php?ID", "</a>")
separacion=split(portada,""">")
id=separacion(Lbound(separacion))
nombre=separacion(Ubound(separacion))
response.write nombre &"<br>"
' controlarsilatengo
fileName = LCase(nombre)
'replace
fileName = replace(fileName,"'","''")
Set Conex=Server.CreateObject("adodb.connection")
Set Tabl=Server.CreateObject("adodb.recordset")
Conex.Open "Driver={Microsoft Access Driver (*.mdb)}; " & "Dbq=" & Server.MapPath("/mdb-database/music.mdb")
Tem="Select * From music Where UCase(pal) like '%" &fileName& "%' order by UCase(pal) asc"
Tabl.Open Tem, Conex,1
If Tabl.BOF And Tabl.EOF Then
nombre1 = replace(nombre,"'","''")
Temp="Select * From audio Where UCase(pal) like '%" &nombre1& "%' order by UCase(pal) asc"
Tabla.Open Temp, Conexion,1
If Tabla.BOF And Tabla.EOF Then
Tabla.AddNew
Tabla("id") = id
Tabla("cover") = nombre
Tabla.update
end if
Tabl.Close
Conex.Close
'fin controlarsilatengo
Loop
objTextFile2.Close
Set objTextFile2 = Nothing
Set objFSO2 = Nothing
next
Tabla.Close
Conexion.Close
%>
Gracias