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

Concatenar con VB Script

Estas en el tema de Concatenar con VB Script en el foro de ASP Clásico en Foros del Web. Muy buenas. Tengo un archivo asp para generar un archivo xml y no se como concatenar unas cosas para que me haga el xml a ...
  #1 (permalink)  
Antiguo 02/10/2008, 12:30
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Concatenar con VB Script

Muy buenas.
Tengo un archivo asp para generar un archivo xml y no se como concatenar unas cosas para que me haga el xml a partir de una consulta. A ver si me pueden ayudar.
Lo que yo tengo es:
Código:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Dim objXML1, fso, tf, ts, s
Const ForReading = 1

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=*****;UID=*****;PWD=*****"
Set Dades = Server.CreateObject("ADODB.RecordSet")
Dades.Open "select distinct ANI,MES from HORARIS",Conn,1
  
Set Dades2 = Server.CreateObject("ADODB.RecordSet")
consulta ="select DIA,MES,ANI,INICINOBLE,FINOBLE,INICIGOLFES,FIGOLFES from HORARIS WHERE MES="+CStr(Dades("MES"))
Dades2.Open consulta,Conn,1

Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(Server.MapPath("xml.xml"))
tf.WriteLine("<?xml version='1.0' encoding='UTF-8'?>")
tf.WriteLine("<BATLLO>")
tf.WriteLine("<TEXT>")
tf.WriteLine("<![CDATA[CODIGO_SECUNDARIO]]>
tf.WriteLine("</TEXT>")
tf.WriteLine("<IMAGEN URL='images/visita_info1.jpg'></IMAGEN>")
tf.WriteLine("<IMAGEN URL='images/visita_info2.jpg'></IMAGEN>")
tf.WriteLine("<IMAGEN URL='images/visita_info3.jpg'></IMAGEN>")
tf.WriteLine("</BATLLO>")
tf.Close
Set fso = nothing
Set tf = nothing
Session.Abandon
%>
En donde pone "CODIGO_SECUNDARIO" en negrita le quiero poner esto:
Código:
<%
do while not Dades.Eof
    %>
     <strong><font face="arial" size=2>
      <%
        if Dades("MES")=1 then
           %>ENERO<%
           txtMes="Enero"
        end if
        if Dades("MES")=2 then
           %>FEBRERO<%
           txtMes="Febrero"
        end if
        if Dades("MES")=3 then
           %>MARZO<%
           txtMes="Marzo"
        end if
        if Dades("MES")=4 then
           %>ABRIL<%
           txtMes="Abril"
        end if
        if Dades("MES")=5 then
           %>MAYO<%
           txtMes="Mayo"
        end if
        if Dades("MES")=6 then
           %>JUNIO<%
           txtMes="Junio"
        end if
        if Dades("MES")=7 then
           %>JULIO<%
           txtMes="Julio"
        end if
        if Dades("MES")=8 then
           %>AGOSTO<%
           txtMes="Agosto"
        end if
        if Dades("MES")=9 then
           %>SEPTIEMBRE<%
           txtMes="Septiembre"
        end if
        if Dades("MES")=10 then
           %>OCTUBRE<%
           txtMes="Octubre"
        end if
        if Dades("MES")=11 then
           %>NOVIEMBRE<%
           txtMes="Noviembre"
        end if
        if Dades("MES")=12 then
           %>DICIEMBRE<%
           txtMes="Diciembre"
        end if%>
        <%=" "+CStr(Dades("ANI"))
      %>
     </font></strong><br>
     <TABLE WIDTH=100%><TR><TD WIDTH=33%>
     <STRONG><font face="arial" size=2>Dia</font></STRONG></TD><TD WIDTH=33%><STRONG><font face="arial" size=2>Planta Noble</font></STRONG></TD><TD WIDTH=34%><STRONG><font face="arial" size=2>Golfes</font></STRONG></TD></TR>
     <%
       Set Dades2 = Server.CreateObject("ADODB.RecordSet")
       consulta ="select DIA,MES,ANI,INICINOBLE,FINOBLE,INICIGOLFES,FIGOLFES from HORARIS WHERE MES="+CStr(Dades("MES"))
       Dades2.Open consulta,Conn,1
       do while not Dades2.Eof
         %>
          <TR><TD><font face="arial" size=2>
          <%=CStr(Dades2("DIA"))+" "+txtMes%>
          </font></TD><TD><font face="arial" size=2>
          de <%=Dades2("INICINOBLE")%>h a <%=Dades2("FINOBLE")%>h
          </font></TD><TD><font face="arial" size=2>
          de <%=Dades2("INICIGOLFES")%>h a <%=Dades2("FIGOLFES")%>h
          </font></TD></TR>
         <%Dades2.MoveNext
       loop
     %></TABLE><BR><%
     Dades.MoveNext
     loop
     %>
Esto lo quiero hacer para luego cargarlo desde flash y recuperar todo el contenido, lo que va entre <![CDATA[ y ]] es un texto que en flash ira con un scroll, por eso necesito ponerlo aqui en medio. Lo que no se es como concatenarlo. En php por ejemplo pones:
Código:
echo "<font size=\"5\">."$variable."</font>";
Yo de ASP no se nada, tengo el ejemplo de generar el xml y le voy añadiendo trozos de documentos, y necesito concatenar eso y no se como se hace.

Muchas gracias de antemano.
Un saludo
  #2 (permalink)  
Antiguo 02/10/2008, 12:42
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Exclamación Respuesta: Concatenar con VB Script

En VBScript para concatenar texto usa el ampersand (&):
Código asp:
Ver original
  1. "texto" & variable & "texto"
En un manual básico de ASP puedes encontrar cómo se realizan las operaciones .

Saludos .
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #3 (permalink)  
Antiguo 02/10/2008, 12:44
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Muchisimas gracias por responder a mi problema y por ser tan rapido.
Voy a probarlo enseguida.

Un saludo
  #4 (permalink)  
Antiguo 02/10/2008, 13:21
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Buenas, he hecho lo que me has dicho tu:
Código:
tf.WriteLine("<![CDATA[ & do while not Dades.Eof & <strong><font face='arial' size=2> & if Dades('MES')=1 then & ENERO & txtMes='Enero' end if if Dades('MES')=2 then & FEBRERO & txtMes='Febrero' end if if Dades('MES')=3 then & MARZO & txtMes='Marzo' end if if Dades('MES')=4 then & ABRIL & txtMes='Abril' end if if Dades('MES')=5 then & MAYO & txtMes='Mayo' end if if Dades('MES')=6 then & JUNIO & txtMes='Junio' end if if Dades('MES')=7 then & JULIO & txtMes='Julio' end if if Dades('MES')=8 then & AGOSTO & txtMes='Agosto' end if if Dades('MES')=9 then & SEPTIEMBRE & txtMes='Septiembre' end if if Dades('MES')=10 then & OCTUBRE & txtMes='Octubre' end if if Dades('MES')=11 then & NOVIEMBRE & txtMes='Noviembre' end if if Dades('MES')=12 then & DICIEMBRE & txtMes='Diciembre' end if &   & CStr(Dades('ANI')) & </font></strong><br><TABLE WIDTH='100%'><TR><TD WIDTH='33%'><STRONG><font face='arial' size=2>Dia</font></STRONG></TD><TD WIDTH='33%'><STRONG><font face='arial' size=2>Planta Noble</font></STRONG></TD><TD WIDTH='34%'><STRONG><font face='arial' size=2>Golfes</font></STRONG></TD></TR> & do while not Dades2.Eof & <TR><TD><font face='arial' size=2> & <%=CStr(Dades2('DIA')) &   & txtMes & </font></TD><TD><font face='arial' size=2> de & <%=Dades2('INICINOBLE') & h a & <%=Dades2('FINOBLE') & h</font></TD><TD><font face='arial' size=2> de & <%=Dades2('INICIGOLFES') & h a & <%=Dades2('FIGOLFES') & h</font></TD></TR> & Dades2.MoveNext loop & </TABLE><BR> & Dades.MoveNext loop & ]]>")
.
Nota: El punto del final dentro del CODE es para que se vea toda la linea bien.

El resultado no es lo que me esperaba, puedes verlo en esta direccion
http://www.casabatllo.es/proves/xml.xml
Fijate tambien que en el resultado no incluye ni "<![CDATA[" ni "]]", que es el principio i el final.

A ver si sabes porque passa esto, yo quiero que ahy muestre los resultados, no el texto en si.

gracias
  #5 (permalink)  
Antiguo 02/10/2008, 13:24
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Perdon, el "<![CDATA[" i el "]]" no se muestran en el resultado del xml.
Pero lo otro a ver si sabeis porque es, no se si he concatenado bieno que...

Un saludo
  #6 (permalink)  
Antiguo 02/10/2008, 13:53
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Pregunta Respuesta: Concatenar con VB Script

Lo cierto es que al final no entendí lo que quieres hacer... .

¿Quieres poner el resultado del código ASP en el CDATA?. Entonces deberías convertirla en una función y concatenar usando el valor de retorno de esa función.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #7 (permalink)  
Antiguo 02/10/2008, 13:57
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Si, es eso mismo lo que quiero hacer.

probare de ponerlo en una funcion y ya te contare.

gracias
  #8 (permalink)  
Antiguo 02/10/2008, 14:10
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

He hecho lo que me has dicho.
El fichero lo tengo asi:
Código:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Dim objXML1, fso, tf, ts, s
Const ForReading = 1

Sub consultesBD()

	Set Conn = Server.CreateObject("ADODB.Connection")
  	Conn.Open "DSN=*****;UID=*****;PWD=*****"
  	Set Dades = Server.CreateObject("ADODB.RecordSet")
  	Dades.Open "select distinct ANI,MES from HORARIS",Conn,1
  
	Set Dades2 = Server.CreateObject("ADODB.RecordSet")
    consulta ="select DIA,MES,ANI,INICINOBLE,FINOBLE,INICIGOLFES,FIGOLFES from HORARIS WHERE MES="+CStr(Dades("MES"))
	Dades2.Open consulta,Conn,1
	
	do while not Dades.Eof
    %>
     <strong><font face="arial" size=2>
      <%
        if Dades("MES")=1 then
           %>ENERO<%
           txtMes="Enero"
        end if
        if Dades("MES")=2 then
           %>FEBRERO<%
           txtMes="Febrero"
        end if
        if Dades("MES")=3 then
           %>MARZO<%
           txtMes="Marzo"
        end if
        if Dades("MES")=4 then
           %>ABRIL<%
           txtMes="Abril"
        end if
        if Dades("MES")=5 then
           %>MAYO<%
           txtMes="Mayo"
        end if
        if Dades("MES")=6 then
           %>JUNIO<%
           txtMes="Junio"
        end if
        if Dades("MES")=7 then
           %>JULIO<%
           txtMes="Julio"
        end if
        if Dades("MES")=8 then
           %>AGOSTO<%
           txtMes="Agosto"
        end if
        if Dades("MES")=9 then
           %>SEPTIEMBRE<%
           txtMes="Septiembre"
        end if
        if Dades("MES")=10 then
           %>OCTUBRE<%
           txtMes="Octubre"
        end if
        if Dades("MES")=11 then
           %>NOVIEMBRE<%
           txtMes="Noviembre"
        end if
        if Dades("MES")=12 then
           %>DICIEMBRE<%
           txtMes="Diciembre"
        end if%>
        <%=" "+CStr(Dades("ANI"))
      %>
     </font></strong><br>
     <TABLE WIDTH=100%><TR><TD WIDTH=33%>
     <STRONG><font face="arial" size=2>Dia</font></STRONG></TD><TD WIDTH=33%><STRONG><font face="arial" size=2>Planta Noble</font></STRONG></TD><TD WIDTH=34%><STRONG><font face="arial" size=2>Golfes</font></STRONG></TD></TR>
     <%
       do while not Dades2.Eof
         %>
          <TR><TD><font face="arial" size=2>
          <%=CStr(Dades2("DIA"))+" "+txtMes%>
          </font></TD><TD><font face="arial" size=2>
          de <%=Dades2("INICINOBLE")%>h a <%=Dades2("FINOBLE")%>h
          </font></TD><TD><font face="arial" size=2>
          de <%=Dades2("INICIGOLFES")%>h a <%=Dades2("FIGOLFES")%>h
          </font></TD></TR>
         <%Dades2.MoveNext
       loop
     %></TABLE><BR><%
     Dades.MoveNext
     loop
	 	
End Sub


Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(Server.MapPath("xml.xml"))
tf.WriteLine("<?xml version='1.0' encoding='UTF-8'?>")
tf.WriteLine("<BATLLO>")
tf.WriteLine("<TEXT>")
tf.WriteLine("<![CDATA[" & consultesBD & "]]>") <--- LINEA 98
tf.WriteLine("</TEXT>")
tf.WriteLine("<IMAGEN URL='images/visita_info1.jpg'></IMAGEN>")
tf.WriteLine("<IMAGEN URL='images/visita_info2.jpg'></IMAGEN>")
tf.WriteLine("<IMAGEN URL='images/visita_info3.jpg'></IMAGEN>")
tf.WriteLine("</BATLLO>")
tf.Close
Set fso = nothing
Set tf = nothing
Session.Abandon
%>
Me lanza este mensaje de error al ejecutarlo:
Código HTML:
Error de Microsoft VBScript en tiempo de ejecución error '800a000d'

No coinciden los tipos: 'consultesBD'

/proves/generarxml.asp, línea 98
La linea 98 esta señalada dentro del CODE

Que puede ser?
Gracias por tu ayuda
  #9 (permalink)  
Antiguo 02/10/2008, 14:17
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Respuesta: Concatenar con VB Script

Esa función en sí ya te va a imprimir un resultado, por lo que no necesitas concatenar, solo escribe lo que va antes, llamas a la función y finalmente escribes lo que va después.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #10 (permalink)  
Antiguo 02/10/2008, 15:16
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

No acabo de entender lo que me dices.
Si pongo esto:
Código:
tf.WriteLine("<![CDATA[consultesBD]]>")
Me pondra el texto consultesBD en una linea del xml. Es lo que he entendido yo.
Como hay que hacerlo entonces..?
Siento mi estupidez...

Gracias
  #11 (permalink)  
Antiguo 03/10/2008, 05:16
Avatar de Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 5 meses
Puntos: 126
Respuesta: Concatenar con VB Script

Hola

Prueba así

Código asp:
Ver original
  1. tf.WriteLine("<![CDATA[Call consultesBD()]]>")

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />
  #12 (permalink)  
Antiguo 03/10/2008, 07:29
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Gracias por responder Adler, pero el resultado no es lo esperado, me escribe entre <TEXT> y </TEXT>, Call consultesBD()

El codigo que genera y lo guarda en el xml es este:
Código:
<BATLLO>
<TEXT>
Call consultesBD()
</TEXT>
<IMAGEN URL="images/visita_info1.jpg"/>
<IMAGEN URL="images/visita_info2.jpg"/>
<IMAGEN URL="images/visita_info3.jpg"/>
</BATLLO>
Como ves me escribe Call consultesBD() y no lo que yo quiero, que es el resultado de dicha funcion.

A ver si alguien sabe como solucionarlo.

Gracias a los dos por haber respondido.

Un saludo
  #13 (permalink)  
Antiguo 03/10/2008, 07:40
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Respuesta: Concatenar con VB Script

Me preguntó qué pasaría si intentaramos así :
Código asp:
Ver original
  1. tf.WriteLine("<![CDATA[")
  2. Call consultesBD()
  3. tf.WriteLine("]]>")
Aunque habría que modificar la función para que escriba en el XML.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #14 (permalink)  
Antiguo 03/10/2008, 07:49
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Asi ya lo probe yo, i muestra el resultado de la funcion por pantalla pero no lo escribe en el xml.

He probado de hacer esto:
Código:
tf.WriteLine("<![CDATA[")
tf.WriteLine(consultesBD)
tf.WriteLine("]]>")
y me lanza este error:
Error de Microsoft VBScript en tiempo de ejecución error '800a000d'

No coinciden los tipos: 'consultesBD'

/proves/generarxml.asp, línea 98
La linea 98 es la que llamo a la funcion.
  #15 (permalink)  
Antiguo 03/10/2008, 07:57
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Exclamación Respuesta: Concatenar con VB Script

No, no es así como debes hacer, como te dije, debes o en la función usar el objeto y escribir en el XML o hacer que la función devuelva el valor que quieres escribir.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #16 (permalink)  
Antiguo 03/10/2008, 08:01
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Si hago lo que tu me dices:
Código:
tf.WriteLine("<![CDATA[")
Call consultesBD()
tf.WriteLine("]]>")
Me saca por pantalla el resultado de la funcion pero no la escribe en el xml. Y lo ultimo que me has dicho no acabo de entenderlo, podrias ser mas claro porfavor.
Siento mucho las molestias, pero es que no tengo mucha idea de ASP, pero tengo que hacer eso para Flash.

Gracias
  #17 (permalink)  
Antiguo 03/10/2008, 08:16
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Exclamación Respuesta: Concatenar con VB Script

Por ejemplo:
Código vb:
Ver original
  1. Function Ejemplo()
  2.    Devolver = "<a>Enlace</a>"
  3.    Devolver = Devolver & vbCrLf & "<img src='imagen.gif' />"
  4.    'Resto de código
  5.   Ejemplo = Devolver
  6. End Function
Fíjate que no escribimos directamente en el HTML sino almacenamos en una variable los contenidos y finalmente devolvemos ese valor que podemos tomarlo en el WriteLine.
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #18 (permalink)  
Antiguo 03/10/2008, 08:59
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Vale, eso me ha funcionado, pero el resultado no lo ejecuta todo, se corta en cierto punto, hace los dos bucles dos veces pero no escribe todo el contenido que tiene que escribir, ya ire mirando que puede ser, algun error de sintaxis o algo...

ya comentare los resultados obtenidos finalmente

Muchas gracias a los dos por ayudarme

Un saludo
  #19 (permalink)  
Antiguo 03/10/2008, 09:12
Avatar de David
Moderador
 
Fecha de Ingreso: abril-2005
Ubicación: In this planet
Mensajes: 15.720
Antigüedad: 19 años, 1 mes
Puntos: 839
Pregunta Respuesta: Concatenar con VB Script

¿Puedes poner cómo lo tienes ahora mismo?
__________________
Por favor, antes de preguntar, revisa la Guía para realizar preguntas.
  #20 (permalink)  
Antiguo 05/10/2008, 03:36
 
Fecha de Ingreso: mayo-2007
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
Respuesta: Concatenar con VB Script

Buenas, perdon por el retraso pero he estado fuera.
Lo que tengo ahora mismo es esto:
Código asp:
Ver original
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <%
  3. Dim objXML1, fso, tf, ts, s
  4. Const ForReading = 1
  5.  
  6.  
  7.  
  8.     Set Conn = Server.CreateObject("ADODB.Connection")
  9.     Conn.Open "DSN=*****;UID=*****;PWD=*****"
  10.     Set Dades = Server.CreateObject("ADODB.RecordSet")
  11.     Dades.Open "select distinct ANI,MES from HORARIS",Conn,1
  12.  
  13.     Set Dades2 = Server.CreateObject("ADODB.RecordSet")
  14.     consulta ="select DIA,MES,ANI,INICINOBLE,FINOBLE,INICIGOLFES,FIGOLFES from HORARIS WHERE MES="+CStr(Dades("MES"))
  15.     Dades2.Open consulta,Conn,1
  16.    
  17.     do while not Dades.Eof
  18.      Response.Write("Bucle1")
  19.      Devolver = "<strong><font face='arial' size=2>"
  20.      
  21.         if Dades("MES")=1 then
  22.            Devolver = Devolver & "ENERO"
  23.            txtMes="Enero"
  24.         end if
  25.         if Dades("MES")=2 then
  26.            Devolver = Devolver & "FEBRERO"
  27.            txtMes="Febrero"
  28.         end if
  29.         if Dades("MES")=3 then
  30.            Devolver = Devolver & "MARZO"
  31.            txtMes="Marzo"
  32.         end if
  33.         if Dades("MES")=4 then
  34.            Devolver = Devolver & "ABRIL"
  35.            txtMes="Abril"
  36.         end if
  37.         if Dades("MES")=5 then
  38.            Devolver = Devolver & "MAYO"
  39.            txtMes="Mayo"
  40.         end if
  41.         if Dades("MES")=6 then
  42.            Devolver = Devolver & "JUNIO"
  43.            txtMes="Junio"
  44.         end if
  45.         if Dades("MES")=7 then
  46.            Devolver = Devolver & "JULIO"
  47.            txtMes="Julio"
  48.         end if
  49.         if Dades("MES")=8 then
  50.            Devolver = Devolver & "AGOSTO"
  51.            txtMes="Agosto"
  52.         end if
  53.         if Dades("MES")=9 then
  54.            Devolver = Devolver & "SEPTIEMBRE"
  55.            txtMes="Septiembre"
  56.         end if
  57.         if Dades("MES")=10 then
  58.            Devolver = Devolver & "OCTUBRE"
  59.            txtMes="Octubre"
  60.         end if
  61.         if Dades("MES")=11 then
  62.            Devolver = Devolver & "NOVIEMBRE"
  63.            txtMes="Noviembre"
  64.         end if
  65.         if Dades("MES")=12 then
  66.            Devolver = Devolver & "DICIEMBRE"
  67.            txtMes="Diciembre"
  68.         end if
  69.         Devolver = Devolver & " " & CStr(Dades("ANI"))
  70.      
  71.      Devolver = Devolver & "</font></strong><br><TABLE WIDTH='100%'><TR><TD WIDTH='33%'><STRONG><font face='arial' size=2>Dia</font></STRONG></TD><TD WIDTH='33%'><STRONG><font face='arial' size=2>Planta Noble</font></STRONG></TD><TD WIDTH='34%'><STRONG><font face='arial' size=2>Golfes</font></STRONG></TD></TR>"
  72.      
  73.        do while not Dades2.Eof
  74.        Response.Write("Bucle2")
  75.      Devolver = Devolver & "<TR><TD><font face='arial' size=2>" & CStr(Dades2("DIA")) & " " & txtMes & "</font></TD><TD><font face='arial' size=2> de " & Dades2("INICINOBLE") & "h a " & Dades2("FINOBLE") & "h</font></TD><TD><font face='arial' size=2>de " &Dades2("INICIGOLFES") & "h a " & Dades2("FIGOLFES") & "h</font></TD></TR>"
  76.           Dades2.MoveNext
  77.        loop
  78.      Devolver = Devolver & "</TABLE><BR>"
  79.      Dades.MoveNext
  80.      loop
  81.        
  82.  
  83. Set fso = CreateObject("Scripting.FileSystemObject")
  84. Set tf = fso.CreateTextFile(Server.MapPath("xml.xml"))
  85. tf.WriteLine("<?xml version='1.0' encoding='UTF-8'?>")
  86. tf.WriteLine("<BATLLO>")
  87. tf.WriteLine("<TEXT>")
  88. tf.WriteLine("<![CDATA[" & Devolver & "]]>")
  89. tf.WriteLine("</TEXT>")
  90. tf.WriteLine("<IMAGEN URL='images/visita_info1.jpg'></IMAGEN>")
  91. tf.WriteLine("<IMAGEN URL='images/visita_info2.jpg'></IMAGEN>")
  92. tf.WriteLine("<IMAGEN URL='images/visita_info3.jpg'></IMAGEN>")
  93. tf.WriteLine("</BATLLO>")
  94. tf.Close
  95. Set fso = nothing
  96. Set tf = nothing
  97. Session.Abandon
  98. %>

A ver si encontrais algo raro. Yo seguire mirando y probando.

Gracias, un saludo
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 00:48.