Hola, estoy teniendo un error en la web que actualmente desarrollo. El error se produce en el archivo ASP. Desafortunadamente, no se porque razón mi servidor IIS 5.1 no me está devolviendo los errores producidos.
Acá les pongo el fuente. Haber si alguien con un poco más de experiencia que yo me puede decir cual es el error en el código.
Código ASP:
Ver originaldim conn, tmp, var, I, respuesta
Set conn = Server.CreateObject("ADODB.Connection")
Set var = server.CreateObject("ADODB.Recordset")
conn.open "Provider=SQLOLEDB.1;Password=;Persist Security Info=True;User ID=sa;Initial Catalog=SoporteSP;Data Source=(local)"
if request.form("Identificacion") = "SubRubroSeleccion" then
dim MStream, Path, PathBajado, Descripcion, Codigo, img, imgArticulo, varArticulo
Set img = server.CreateObject("ADODB.Recordset")
Set MStream = Server.CreateObject("ADODB.Stream")
MStream.Type = 1
MStream.Open
tmp = "SELECT Id_Articulo, Descripcion, Codigo, Precio1 FROM Articulos WHERE Rubro =" & request.form("RubroElegido") & " AND Articulos.Subrubro =" & request.form("SubRubroElegido") & " ORDER BY Descripcion"
var.open tmp, conn, 1, 1
tmp = "SELECT Imagenes.Id_Articulo, Imagenes.Imagen, Imagenes.Path FROM Imagenes INNER JOIN Articulos ON Imagenes.Id_Articulo = Articulos.Id_Articulo WHERE Rubro =" & request.form("RubroElegido") & " AND Articulos.Subrubro =" & request.form("SubRubroElegido")
img.Open tmp, conn, 1, 1
respuesta = "{Formulario: 'SubRubroSeleccion', Precio: ["
Descripcion = "Descripcion: ["
Codigo = "Codigo: ["
Path = "Path: ["
For I = 1 To var.RecordCount - 1
respuesta = respuesta & "'" & "" & var("Precio1") & "', "
Descripcion = Descripcion & "'" & "" & var("Descripcion") & "', "
Codigo = Codigo & "'" & "" & var("Codigo") & "', "
If Not img.EOF Then
If img("Id_Articulo").Value = var("Id_Articulo").Value Then
Path = Path & "'" & Session("Path") & "/" & "" & img("Path").Value & "', "
PathBajado = Server.MapPath("." & Session("Path") & "/" & "" & img("path").Value)
MStream.Write img("Imagen").value
MStream.SaveToFile PathBajado, 2
img.movenext
else
Path = Path & "'./temp/ImagenNoDisponible.jpg', "
end if
var.movenext
else Path = Path & "'./temp/ImagenNoDisponible.jpg', "
end if
next
respuesta = respuesta & "'" & "" & var("Precio1") & "'], "
Descripcion = Descripcion & "'" & "" & var("Descripcion") & "'], "
Codigo = Codigo & "'" & "" & var("Codigo") & "'], "
if Not img.eof then
if img("Id_Articulo").Value = var("Id_Articulo").Value then
Path = Path & "'" & Session("Path") & "/" & "" & img("Path").Value & "']}"
PathBajado = Server.MapPath("." & Session("Path") & "/" & "" & img("Path").Value)
MStream.Write img("Imagen").value
MStream.SaveToFile PathBajado, 2
img.movenext
else
Path = Path & "'./temp/ImagenNoDisponible.jpg']}"
end if
else
Path = Path & "'./temp/ImagenNoDisponible.jpg']}"
end if
respuesta = respuesta & Descripcion & Codigo & Path
end if
Vale aclarar que este código crea una cadena con el formato JSON que posteriormente recibe un archivo JS.
Este código lo probé en VB6 y me funciono (cambiandole el código propiamente de ASP). Ya se que me dirán que VB6 y ASP3 no son los mismo, lo cual reconosco, pero son bastante parecidos.
Nada más que decir, simplemente un pedido de auxilio porque esto ya me tiene frustrado.
Desde ya muchas gracias.