Ver Mensaje Individual
  #4 (permalink)  
Antiguo 25/06/2010, 14:58
Avatar de Fabu_dina
Fabu_dina
 
Fecha de Ingreso: enero-2004
Mensajes: 425
Antigüedad: 21 años, 3 meses
Puntos: 1
Respuesta: Error al crear XML en Win 2003 server

les pongo el codigo


Código:
<%
Response.ContentType = "application/xhtml+xml"
Response.Charset = "utf-8"

page	 	= CInt(Request("page"))
rp			= CInt(Request("rows"))
sortname	= Request("sidx")
sortorder	= Request("sord")

if sortname = "" then
	sortname = "cliente_id"
end if	
if sortorder = "" then
	sortorder = "asc"
end if	

order 		= "Order By "&sortname&" "&sortorder&"" 

if page = "" then
	page = 2
end if	
if rp = 0 then
	rp = 10
end if	

strStart = (rp*page) -rp
strStart = (page -1) * rp

If (strStart < 0) Then
	strStart = 0
End If

limit ="Limit "&strStart&","&cdbl(rp)&""

strSearchOn	= Request("_search")
If (strSearchOn = "true") Then
strField	= Request("searchField")
	If (strField = "cliente_id" Or "cliente_nombre" Or strField = "cliente_telefono") Then
		strFieldData	= Request("searchString")
		strSearchOper	= Request("searchOper")
		'construct where
		strWhere =  " where " & trField

		Select Case strSearchOper
		Case "bw" : 'Begin With
			strFieldData = strFieldData & "%"
			strWhere = strWhere & " LIKE '" & strFieldData & "'"
		Case "eq" : 'Equal
			If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " = " & strFieldData
			Else
					strWhere = strWhere & " = '" & strFieldData & "'"
			End If
		Case "ne": 'Not Equal
				If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " <> " & strFieldData
				Else
					strWhere = strWhere & " <> '"& strFieldData &"'"
				End If
		Case "lt": 'Less Than
				If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " < " & strFieldData
				Else
					strWhere = strWhere & " < '"& strFieldData &"'"
				End If
		Case "le": 'Less Or Equal
				If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " <= " & strFieldData
				Else
					strWhere = strWhere & " <= '"& strFieldData &"'"
				End If
		Case "gt": 'Greater Than
				If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " > " & strFieldData
				Else
					strWhere = strWhere & " > '"& strFieldData &"'"
				End If
		Case "ge": 'Greater Or Equal
				If(IsNumeric(strFieldData)) Then
					strWhere = strWhere & " >= " & strFieldData
				Else
					strWhere = strWhere & " >= '"& strFieldData &"'"
				End If
		Case "ew" : 'End With
			strWhere = strWhere & " LIKE '%" & strFieldData & "'"
		Case "cn" : 'Contains
			strWhere = strWhere & " LIKE '%" & strFieldData & "%'"
		End Select
	End if
End If

Set Conn_sql = Server.CreateObject("ADODB.Connection")
Conn_sql.Open ConString_intranet
set rs_info = server.CreateObject("ADODB.Recordset")

sql = "Select * From cliente "&strWhere&" "&order&" "&limit&" "
Set rs		= Conn_SQL.Execute(sql)

'$total = countRec("iso","country $where");
sql_total = "Select count(cliente_id) as total From cliente "&strWhere
Set rs_total		= Conn_SQL.Execute(sql_total)


if ( cdbl(rs_total("total")) mod cdbl(rp) ) > 0 then
	total_paginas = cint(( cdbl(rs_total("total")) / cdbl(rp) )) +1
else
	total_paginas = ( cdbl(rs_total("total")) / cdbl(rp) )
end if



Response.Write ("<?xml version='1.0' encoding='iso-8859-1'?>")
Response.Write ("<rows>")
Response.Write ("<page>"&cdbl(Page)&"</page>")
Response.Write ("<total>"&cdbl(total_paginas)&"</total>")
Response.Write ("<records>"&cdbl(rs_total("total"))&"</records>")
if Not rs.Eof then
rs.MoveFirst
Do While Not rs.Eof

Response.contenttype = "text/xml"
Response.Write "<row id='"&rs("cliente_id")&"'>"
Response.Write "<cell>"&rs("cliente_id")&"</cell>"
Response.Write "<cell><![CDATA["&rs("cliente_nombre")&"]]></cell>"
Response.Write "<cell><![CDATA["&rs("cliente_telefono")&"]]></cell>"

Response.Write "</row>"

rs.MoveNext
Loop
end if

Response.Write "</rows>"


%>
EN MI MAQUINA EN LOCALHOST NO ME DA PROBLEMA TENGO XP Y EN EL SERVER SI ME MARCA EL ERROR