Foros del Web » Programando para Internet » ASP Clásico »

loop sin do

Estas en el tema de loop sin do en el foro de ASP Clásico en Foros del Web. Hola a todos. Otra vez con otro problema. A ver si alguien me puede decir por qué en el siguiente código me da error loop ...
  #1 (permalink)  
Antiguo 20/08/2008, 08:52
Avatar de eeeee  
Fecha de Ingreso: febrero-2004
Ubicación: Almería
Mensajes: 397
Antigüedad: 21 años, 2 meses
Puntos: 0
loop sin do

Hola a todos.

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:
<%
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
%>
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.

Gracias
__________________
Eusol .............
aprendiendo de ustedes
________________________

http://www.alicun.com
  #2 (permalink)  
Antiguo 20/08/2008, 08:57
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 4 meses
Puntos: 98
Respuesta: loop sin do

Hola,

Por aqui en algun lado te falta un end if

Código:
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
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #3 (permalink)  
Antiguo 20/08/2008, 09:13
Avatar de eeeee  
Fecha de Ingreso: febrero-2004
Ubicación: Almería
Mensajes: 397
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: loop sin do

Si u_goldman

Tienes razón le faltaba un end if justo debajo del otro,
pero me sigue dando el mismo error en la misma linea,
porque donde pone 'replace en el código hace un #include a una serie de replaces entre los que se encuentra un while ..... wend.

Será por esto??

Gracias
__________________
Eusol .............
aprendiendo de ustedes
________________________

http://www.alicun.com
  #4 (permalink)  
Antiguo 20/08/2008, 09:19
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 4 meses
Puntos: 98
Respuesta: loop sin do

Mmmhhh salvo que alguién más vea algo mal en ese código, si ya le pusiste el end if, hasta ahí está bien, ahora tendríamos que ver el código del include para ver si ahí se encuentra el error, por qué no lo pegas así le podemos echar un vistazo?

Saludos
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #5 (permalink)  
Antiguo 20/08/2008, 09:29
Avatar de eeeee  
Fecha de Ingreso: febrero-2004
Ubicación: Almería
Mensajes: 397
Antigüedad: 21 años, 2 meses
Puntos: 0
Respuesta: loop sin do

Bien gracias por responder u_goldman.
Resulta que la parte donde va el end if que faltaba, era tambien del include,
lo probé con ese mismo código y funcionó, despues eliminé esa parte e incluí el <!-- #include file = "replace.asp" --> pero me olvidé de poner el end if.

Gracias otra vez, ya está solucionado

Salu2
__________________
Eusol .............
aprendiendo de ustedes
________________________

http://www.alicun.com
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:39.