Jump to content


PromoGift

Member Since 29/09/2007
Offline Last Active 22/03/2009, 15:43
-----

Posts I've Made

In Topic: Problema Abrir Xml No Firefox

22/03/2009, 15:42

Observe novamente uma instanciação ao objeto da Microsoft:

Set sc = CreateObject("Microsoft.XMLHTTP")

Lembre-se, MS é incompatível com FF.
Eu não sei se seu servidor te disponibiliza outros objetos pra xml, mas com certeza deverá encontrar um que seja para o FF, e instanciá-lo, caso for FF.

Script de verificar navegador você encontra aqui no fórum msm.

/*DarkSign*/



FALA MEU VEIO... TO COM ESSE PROBLEMA RESOLVIDO... QUALQUER COISA PODE ME CONTACTAR QUE TE AJUDO...

ABRAÇOS...

In Topic: Problema Abrir Xml No Firefox

20/03/2009, 00:43

Olá, não analisei o código inteiro, mas já de cara percebi uma coisa:

Set xml = Server.CreateObject("msxml2.DOMDocument.3.0")

Observe que objeto você está criando MSxml2, ou seja, MicroSoft xml, etc.

Então, ao meu ver, o Firefox simplesmente não reconhece o objeto.
Procure um objeto XML mais genérico, ou instancie um objeto para o FF através de condicionais.

/*DarkSign*/


Entao eu teria que criar uma condicional para o FF? Poderia me ajudar nisso? Porque ja tentei de TUDO, mas nao adiantou.
Nao passei o codigo todo, porque tenho quase certeza que o problema esta nesse pequeno pedaço, mas se for o caso posto ele todo aqui.

Esse é o codigo completo do arquivo asp.

<%
SELECT CASE request("acao")

'**********************************************************************************
'FUNÇÃO PARA CALCULAR O FRETE
'**********************************************************************************
CASE "calcular_frete"
Response.Charset="ISO-8859-1"
session("cep_entrega") = pform("cep")



Cn_cep
sql = "SELECT * FROM enderecos WHERE cep='"&session("cep_entrega")&"'"
set vr = cnx.execute(sql)
if vr.bof or vr.eof then

'ARQUIVO RESPONSÁVEL POR PEGAR O ENDEREÇO DO CEP DIGITADO
caminho="http://www.bronzebusiness.com.br/webservices/wscep.asmx/cep?strcep="&session("cep_entrega")&""
Set xml = Server.CreateObject("msxml2.DOMDocument.3.0")
xml.async = false
xml.setProperty "ServerHTTPRequest", true
xml.validateOnParse =false
xml.preserveWhiteSpace = false
folha = xml.Load(caminho)

If Not folha Then
endereco = "invalido"
bairro  =   "invalido"
cidade =  "invalido"
estado = "invalido"
Else

Set logradouro = xml.getElementsByTagName("logradouro")
Set nome = xml.getElementsByTagName("nome")
Set bairro = xml.getElementsByTagName("bairro")
Set uf = xml.getElementsByTagName("UF")
Set cidade = xml.getElementsByTagName("cidade")

  
if logradouro.length > 0 then
endereco = logradouro.item(0).text & " " & nome.item(0).text
bairro  =   bairro.item(0).text
cidade =  cidade.item(0).text
estado = uf.item(0).text
set gravar = cnx.execute("INSERT INTO enderecos (logradouro, cep, nome, bairro, cidade, uf) values ('"&logradouro.item(0).text&"', '"&session("cep_entrega")&"', '"&nome.item(0).text&"', '"&bairro&"', '"&cidade&"', '"&estado&"')")
else

endereco = "invalido"
bairro  =   "invalido"
cidade =  "invalido"
estado = "invalido"


end if
end if
'aqui é da funçao
else
endereco = vr("logradouro") & " " & vr("nome")
bairro =   vr("bairro")
cidade =  vr("cidade")
estado = vr("uf")
end if
Des_cep



'pega todos os produtos comprados e calcula o peso
Conectar
set rs = conexao.execute("SELECT * FROM cesta WHERE compra='"&session("id_compra")&"'")
kg = 0
valor = 0
while not rs.eof
set pd = conexao.execute("SELECT preco, peso FROM produtos WHERE id='"&rs("produto")&"'")
kg = kg + (pd("peso") * rs("quantidade"))
valor = valor + (pd("preco") * rs("quantidade"))
rs.movenext
wend
Desconectar

'prepara os ítens para cálculo
um = formatnumber(kg,3)
peso = replace(um, ",", ".")
session("peso") = peso

cep_origem = dados("cep", "config_frete", "")
cep_destino = session("cep_entrega")
valor_declarado = replace(formatnumber(valor,2), ".", "")

'formas de entrega a ser calculadas
sedex_normal = dados("sedex", "config_frete", "")
sedex_acrescimo = dados("sedex_acrescimo", "config_frete", "")
sedex_seguro = dados("sedex_seguro", "config_frete", "")

sedex_10 = dados("sedex_10", "config_frete", "")
dez_acrescimo = dados("sedex_10_acrescimo", "config_frete", "")
dez_seguro = dados("sedex_10_seguro", "config_frete", "")

sedex_cobrar = dados("sedex_cobrar", "config_frete", "")
cobrar_acrescimo = dados("sedex_cobrar_acrescimo", "config_frete", "")
cobrar_seguro = dados("sedex_cobrar_seguro", "config_frete", "")

encomenda_normal = dados("encomenda_normal", "config_frete", "")
en_acrescimo = dados("en_acrescimo", "config_frete", "")

transportadora = dados("transportadora", "config_frete", "")

entrega_local = dados("entrega_local", "config_frete", "")
descricao_local = dados("descricao_entregalocal", "config_frete", "")
regiao_local = dados("regiao_entregalocal", "config_frete", "")
valor_local = dados("valor_entregalocal", "config_frete", "")
area_entregalocal = dados("area_entregalocal", "config_frete", "")
carta_registrada = dados("carta_registrada", "config_frete", "")
peso_cartaregistrada = dados("peso_cartaregistrada", "config_frete", "")
valor_cartaregistrada = dados("valor_cartaregistrada", "config_frete", "")


'identifica estado do cep de destino

 If cep_destino >= 69900000 And cep_destino <= 69999999 Then
	If cep_destino >= 69900000 And cep_destino <= 69920999 Then
		session("estado_destino") = "Acre - Capital"
	else	
		session("estado_destino") = "Acre - Interior"
	end if	
  ElseIf cep_destino >= 57000000 And cep_destino <= 57999999 Then
	If cep_destino >= 57000000 And cep_destino <= 57099999 Then
		session("estado_destino") = "Alagoas - Capital"
	else
		session("estado_destino") = "Alagoas - Interior"
	end if
  ElseIf cep_destino >= 68900000 And cep_destino <= 68999999 Then
	  If cep_destino >= 68900000 And cep_destino <= 68909999 OR cep_destino >= 68925000 And cep_destino <= 68929999 Then
		session("estado_destino") = "Amapá - Capital"
	else	
		session("estado_destino") = "Amapá - Interior"
	end if	
  ElseIf cep_destino >= 69000000 And cep_destino <= 69899999 Then
	  If cep_destino >= 69000000 And cep_destino <= 69099999 Then
		session("estado_destino") = "Amazonas - Capital"
	else	
		session("estado_destino") = "Amazonas - Interior"
	end if
  ElseIf cep_destino >= 40000000 And cep_destino <= 48999999 Then
	If cep_destino >= 40000000 And cep_destino <= 43849999 OR cep_destino >= 44450000 And cep_destino <= 44470999 Then
		session("estado_destino") = "Bahia - Capital"
	else
		session("estado_destino") = "Bahia - Interior"
	end if
  ElseIf cep_destino >= 60000000 And cep_destino <= 63999999 Then
	If cep_destino >= 60000000 And cep_destino <= 61699999 OR cep_destino >= 61900000 And cep_destino <= 61939999 Then
		session("estado_destino") = "Ceará - Capital"
	else
		session("estado_destino") = "Ceará - Interior"
	end if	
  ElseIf cep_destino >= 70000000 And cep_destino <= 72799999 Then
	If cep_destino >= 70000000 And cep_destino <= 72799999 OR cep_destino >= 73000999 And cep_destino <= 73699999 Then
		session("estado_destino") = "Distrito Federal - Capital"
	else
		session("estado_destino") = "Distrito Federal - Interior"
	end if	
  ElseIf cep_destino >= 29000000 And cep_destino <= 29999999 Then
	  If cep_destino >= 29000000 And cep_destino <= 29184999 Then
		session("estado_destino") = "Espirito Santo - Capital"
	else	
		session("estado_destino") = "Espirito Santo - Interior"
	end if	
  ElseIf cep_destino >= 72800000 And cep_destino <= 76999999 Then
	If cep_destino >= 74000000 And cep_destino <= 74999999 OR cep_destino >= 75250000 And cep_destino <= 75259999 Then
		session("estado_destino") = "Goiás - Capital"
	else
		session("estado_destino") = "Góiás - Interior"
	end if	
  ElseIf cep_destino >= 65000000 And cep_destino <= 65999999 Then
	If cep_destino >= 65000000 And cep_destino <= 65099999 Then
		session("estado_destino") = "Maranhão - Capital"
	else
		session("estado_destino") = "Maranhão - Interior"
	end if	
  ElseIf cep_destino >= 78000000 And cep_destino <= 78899999 Then
	If cep_destino >= 78000000 And cep_destino <= 78169999 Then
		session("estado_destino") = "Mato Grosso - Capital"
	else
		session("estado_destino") = "Mato Grosso - Interior"	
	end if
  ElseIf cep_destino >= 79000000 And cep_destino <= 79999999 Then
	  If cep_destino >= 79000000 And cep_destino <= 79124999 Then
		session("estado_destino") = "Mato Grosso do Sul - Capital"
	else
		session("estado_destino") = "Mato Grosso do Sul - Interior"
	end if
  ElseIf cep_destino >= 30000000 And cep_destino <= 39999999 Then
	  If cep_destino >= 30000000 And cep_destino <= 34999999 Then
		session("estado_destino") = "Minas Gerais - Capital"
	else
		session("estado_destino") = "Minas Gerais - Interior"
	end if	
  ElseIf cep_destino >= 66000000 And cep_destino <= 68899999 Then
	  If cep_destino >= 66000000 And cep_destino <= 67999999 Then
		session("estado_destino") = "Pará - Capital"
	else	
		session("estado_destino") = "Pará - Interior"
	end if	
  ElseIf cep_destino >= 58000000 And cep_destino <= 58999999 Then
	  If cep_destino >= 58000000 And cep_destino <= 58099999 Then
		session("estado_destino") = "Paraiba - Capital"
	else
		session("estado_destino") = "Paraiba - Interior"
	end if	
  ElseIf cep_destino >= 80000000 And cep_destino <= 87999999 Then
	If cep_destino >= 80000000 And cep_destino <= 83189999 OR cep_destino >= 83300000 And cep_destino <= 83349999 OR cep_destino >= 83400000 And cep_destino <= 83749999 OR cep_destino >= 83800000 And cep_destino <= 83939999 Then
		session("estado_destino") = "Paraná - Capital"
	else
		session("estado_destino") = "Paraná - Interior"
	end if	
  ElseIf cep_destino >= 50000000 And cep_destino <= 56999999 Then
	If cep_destino >= 50000000 And cep_destino <= 53989999 OR cep_destino >= 54000000 And cep_destino <= 54799999 Then
		session("estado_destino") = "Pernambuco - Capital"
	else	
		session("estado_destino") = "Pernambuco - Interior"
	end if	
  ElseIf cep_destino >= 64000000 And cep_destino <= 64999999 Then
	If cep_destino >= 64000000 And cep_destino <= 64999999 Then
		session("estado_destino") = "Piauí - Capital"
	else	
		session("estado_destino") = "Piauí - Interior"
	end if	
  ElseIf cep_destino >= 20000000 And cep_destino <= 28999999 Then
	  If cep_destino >= 20000000 And cep_destino <= 23799999 OR cep_destino >= 24000000 And cep_destino <= 24799999 Then
		session("estado_destino") = "Rio de Janeiro - Capital"
	else	
		session("estado_destino") = "Rio de Janeiro - Interior"
	end if	
  ElseIf cep_destino >= 59000000 And cep_destino <= 59999999 Then
	  If cep_destino >= 59000000 And cep_destino <= 59149999 Then
		session("estado_destino") = "Rio Grande do Norte - Capital"
	else	
		session("estado_destino") = "Rio Grande do Norte - Interior"
	end if	
  ElseIf cep_destino >= 90000000 And cep_destino <= 99999999 Then
	  If cep_destino >= 90000000 And cep_destino <= 91999999 Then
		session("estado_destino") = "Rio Grande do Sul - Capital"
	else	
		session("estado_destino") = "Rio Grande do Sul - Interior"
	end if	
  ElseIf cep_destino >= 78900000 And cep_destino <= 78999999 Then
	  If cep_destino >= 78900000 And cep_destino <= 78924999 Then
		session("estado_destino") = "Rondônia - Capital"
	else	
		session("estado_destino") = "Rondônia - Interior"
	end if	
  ElseIf cep_destino >= 69300000 And cep_destino <= 69399999 Then
	If cep_destino >= 69300000 And cep_destino <= 69339999 Then
		session("estado_destino") = "Roraima - Capital"
	else	
		session("estado_destino") = "Roraima - Interior"
	end if	
  ElseIf cep_destino >= 77000000 And cep_destino <= 77999999 Then
	  If cep_destino >= 77000000 And cep_destino <= 77299999 Then
		session("estado_destino") = "Tocantins - Capital"
	else	
		session("estado_destino") = "Tocantins - Interior"
	end if	
  ElseIf cep_destino >= 88000000 And cep_destino <= 89999999 Then
	  If cep_destino >= 88000000 And cep_destino <= 88149999 OR cep_destino >= 88160000 And cep_destino <= 888179999 Then
		session("estado_destino") = "Santa Catarina - Capital"
	else	
		session("estado_destino") = "Santa Catarina - Interior"
	end if	
  ElseIf cep_destino >= 01000000 And cep_destino <= 19999999 Then
	  If cep_destino >= 01000000 And cep_destino <= 09999999 Then
		session("estado_destino") = "São Paulo - Capital"
	else	
		session("estado_destino") = "São Paulo - Interior"
	end if	
  ElseIf cep_destino >= 49000000 And cep_destino <= 49999999 Then
	  If cep_destino >= 49000000 And cep_destino <= 49099999 Then
		session("estado_destino") = "Sergipe - Capital"
	else	
		session("estado_destino") = "Sergipe - Interior"
	end if	
  End If

'calcula os fretes pelos correios
'41017 - Encomenda Normal
if encomenda_normal = "s" then

en_url = "http://www.correios.com.br/encomendas/precos/calculo.cfm?servico=41106&cepDestino="& cep_destino &"&CepOrigem="& cep_origem &"&peso="& session("peso") &""

Set en = CreateObject("Microsoft.XMLHTTP")
en.open "post", en_url, false
en.send
en_valor = en.responseText
set en = nothing

p = right(en_valor,len(en_valor)-instr(en_valor,"Tarifa"))
s = right(p,len(p)-instr(p,"Tarifa"))
enc = replace(replace(left(right(s,len(s)-6),5),"&",""),".",",")
enc = replace(enc, "e", "")
enc = replace(enc, "r", "")
enc = replace(enc, "a", "")
enc = replace(enc, "u", "")
enc = replace(enc, "i", "")
enc = replace(enc, "r", "")
if en_acrescimo <> 0 and en_acrescimo <> "" then
ence = acrescimo(enc, en_acrescimo)
else
ence = enc
end if

session("en") = ence
end if



'40010 = Sedex Convencional
if sedex_normal = "s" then
if sedex_seguro = "s" then
adicional_sn = "&ValorDeclarado="&valor_declarado&""
end if
sn_url="http://www.correios.com.br/encomendas/precos/calculo.cfm?Servico=40010&CepDestino="& cep_destino &"&CepOrigem="& cep_origem &"&Peso="& peso&""&adicional_sn&""
		
Set sn = CreateObject("Microsoft.XMLHTTP")
sn.open "post", sn_url,false
sn.send
sn_valor = sn.responseText
set sn = nothing
na = right(sn_valor,len(sn_valor)-instr(sn_valor,"Tarifa"))
nb = right(na,len(na)-instr(na,"Tarifa"))
nc = replace(replace(left(right(nb,len(nb)-6),5),"&",""),".",",")
nd = replace(replace(nc, "e", ""), "r", "")
if sedex_acrescimo <> 0 and sedex_acrescimo <> "" then
ne = acrescimo(nd, sedex_acrescimo)
else
ne = nd
end if
session("sn") = ne
end if


'40215 = Sedex 10
if sedex_10 = "s" then
if dez_seguro = "s" then
adicional_sd = "&ValorDeclarado="&valor_declarado&""
end if

sd_url="http://www.correios.com.br/encomendas/precos/calculo.cfm?Servico=40215&CepDestino="& cep_destino &"&CepOrigem="& cep_origem &"&Peso="& peso&""&adicional_sd&""
		
Set sd = CreateObject("Microsoft.XMLHTTP")
sd.open "post", sd_url,false
sd.send
sd_valor = sd.responseText
set sd = nothing
da = right(sd_valor,len(sd_valor)-instr(sd_valor,"Tarifa"))
db = right(da,len(da)-instr(da,"Tarifa"))
dc = replace(replace(left(right(db,len(db)-6),5),"&",""),".",",")
dd = replace(replace(dc, "e", ""), "r", "")
if dez_acrescimo <> 0 and dez_acrescimo <> "" then
de = acrescimo(dd, dez_acrescimo)
else
de = dd
end if

session("sd") = de
end if



'40045 = Sedex à Cobrar
if sedex_cobrar = "s" then
if cobrar_seguro = "s" then
adicional_sc = "&ValorDeclarado="&valor_declarado&""
end if

sc_url="http://www.correios.com.br/encomendas/precos/calculo.cfm?Servico=40045&CepDestino="& cep_destino &"&CepOrigem="& cep_origem &"&Peso="& peso&""&adicional_sc&""
Set sc = CreateObject("Microsoft.XMLHTTP")
sc.open "post", sc_url,false
sc.send
sc_valor = sc.responseText
set sc = nothing
ca = right(sc_valor,len(sc_valor)-instr(sc_valor,"Tarifa"))
cb = right(ca,len(ca)-instr(ca,"Tarifa"))
cc = replace(replace(left(right(cb,len(cb)-6),5),"&",""),".",",")
cd = replace(replace(cc, "e", ""), "r", "")
if cobrar_acrescimo <> 0 and cobrar_acrescimo <> "" then
ce = acrescimo(cd, dez_acrescimo)
else
ce = cd
end if

session("sc") = ce
end if

'Entrega Local

if entrega_local = "s" then

if session("estado_destino") = area_entregalocal then
	session("motoboy") = True
	else
	session("motoboy") = False
	end if
end if
id = 0

response.write session("estado_destino")%>
###<table width="100%" border="0" cellspacing="0" cellpadding="0">
					 <form action="oct_atu_compra.asp" method="post" name="seguir" id="seguir"> 
					   <tr>
						<td height="30" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
						  
						  <tr>
							<td height="25" align="left"><span style="font-weight:bold">Endere&ccedil;o para Entrega: </span>Por favor, informe o endere&ccedil;o para Entrega. </td>
						  </tr>
						  <tr>
							<td height="1" align="left" bgcolor="#CCCCCC"></td>
						  </tr>
						  <tr>
							<td height="25" align="left" bgcolor="#FBFBFB" ><table width="100%" border="0" cellpadding="5" style="line-height:25px">
							  <tr>
								<td><table width="100%" border="0">
									<tr>
									  <td width="68" height="25" align="right"><strong>Endere&ccedil;o:</strong></td>
									  <td width="1283"><%if endereco<>"invalido" then
								
								response.write endereco
								end if%><input name="endereco" <% if endereco = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=endereco%>"<%end if%> id="endereco"/></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>N&uacute;mero:</strong></td>
									  <td><input name="numero" type="text" id="numero" size="4" /></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>Compl.:</strong></td>
									  <td><input name="complemento" type="text" id="complemento" /></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>Cep:</strong></td>
									  <td><%=session("cep_entrega")%></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>Bairro:</strong></td>
									  <td><%if bairro<>"invalido" then
								
								response.write bairro
								end if%><input name="bairro" <% if bairro = "invalido" then%>type="text" size="50" <%else%>type="hidden" value="<%=bairro%>" <%end if%> id="bairro"/></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>Cidade:</strong></td>
									  <td><%if cidade<>"invalido" then
								
								response.write cidade
								end if%><input name="cidade" <% if cidade = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=cidade%>"<%end if%> id="cidade"/></td>
									</tr>
									<tr>
									  <td height="25" align="right"><strong>Estado:</strong></td>
									  <td><%if estado<>"invalido" then
								
								response.write estado
								end if%><input name="estado" <% if estado = "invalido" then%>type="text" size="50"<%else%>type="hidden" value="<%=estado%>"<%end if%> id="estado"/></td>
									</tr>
								  </table>
								</td>
							  </tr>
							</table></td>
						  </tr>
						</table>						
					   <p><span style="font-weight:bold">Forma de Entrega: </span></p></td>
					  </tr>
						<tr>
							<td height="1" align="left" bgcolor="#CCCCCC"></td>
					   </tr>
					  <%if session("sn") <> 0 and sedex_normal="s" and session("sotransportadora") <> "Sim" then
					  id = id + 1 %>
					  <tr>
						<td bgcolor="#FBFBFB"><table width="100%" border="0" cellpadding="5">
						  <tr><td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="sn" onClick="totalcompra('<%=FormatNumber(session("sn"),2)%>');"  >
							<strong>Sedex - R$ <%=FormatNumber(session("sn"),2)%><br>
						  </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prazo: Capital de todo Brasil: 02 a 03 dias. Interior de Todo Brasil: 03 a 04 dias.</td>
					  </tr>
					  <%end if%>
					  <%if session("sd") <> 0 and sedex_10="s" and session("sotransportadora") <> "Sim" then
					 id = id + 1   %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="sd" onClick="totalcompra('<%=FormatNumber(session("sd"),2)%>');" >
							<strong>Sedex 10 - R$ <%=FormatNumber(session("sd"),2)%><br>
						  </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="verdana size10">Prazo: At&eacute; as 10 horas do dia seguinte para pedidos efetuados at&eacute; &agrave;s 13:00 hs. </span></td>
					  </tr>
					  <%end if%>
					  <%if session("sc") <> 0 and sedex_cobrar="s"  and session("sotransportadora") <> "Sim" then
					   id = id + 1 %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="sc" onClick="totalcompra('<%=FormatNumber(session("sc"),2)%>');" >
							<strong>Sedex &agrave; cobrar - R$ <%=FormatNumber(session("sc"),2)%><br>
						  </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="verdana size10">Prazo: Capital de todo Brasil: 02 a 03 dias. Interior de Todo Brasil: 03 a 04 dias.</span></td>
					  </tr>
					  <%end if%>
					  <%if encomenda_normal = "s"  and session("en") <> 0 and session("en") <> "" and session("sotransportadora") <> "Sim" then
					   id = id + 1 %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="en" onClick="totalcompra('<%=FormatNumber(session("en"),2)%>');">
							<strong>Encomenda Normal - R$ <%=FormatNumber(session("en"),2)%></strong><br>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prazo: Capital de todo Brasil: 05 a 07 dias. Interior de Todo Brasil: 07 a 15 dias.</td>
					  </tr>
					  <%end if%>
					  <%if session("motoboy") = True and entrega_local = "s"  and session("sotransportadora") <> "Sim" then
					   id = id + 1 %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="el"  onclick="totalcompra('<%=FormatNumber(valor_local,2)%>');" />
						  <strong><%=descricao_local%> - R$ <%=FormatNumber(valor_local,2)%></strong><br>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=regiao_local%></td></tr>
					  <%
					end if
					
					if carta_registrada = "s"  and session("sotransportadora") <> "Sim" and  replace(formatnumber(peso_cartaregistrada,3), ",", ".") => session("peso") then
					 id = id + 1 %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="cr" onClick="totalcompra('<%=FormatNumber(valor_cartaregistrada,2)%>');" >
							<strong>Carta Registrada - R$ <%=FormatNumber(valor_cartaregistrada,2)%></strong><br>
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prazo: Para todo o Brasil de 15 a 25 dias.</td></tr><%end if
						if transportadora = "s" then
						id = id + 1 %>
					  <tr>
						<td height="44" ><input style="border:none" name="frete" id="f<%=id%>"  type="radio" value="tr" onclick="totalcompra('0');" />
						  <strong>Transportadora</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;O Valor e o Prazo ser&aacute; definido posteriormente por um atendente, buscando a melhor tarifa.</td>
					  </tr>
					  <%end if%>
						</table></td>
					  </tr>
  </form>
					</table>


  <%


						

END SELECT




%>



Fala meu amigo, conseguiu resolver este problema ai ? tenho o mesmo problema no mesmo codigo que voce.

aguardo e abraços.

In Topic: Adodb.field Erro '80020009'

06/03/2009, 15:40

Inclua a verificação:

If Not Pedidos.EOF Then
Veja os blocos que podem ser unidos, pois o recordSet é usado mais vezes na página.
E essa verificação deve englobar a parte do script que usa o recordSet.


Olá Renan,

Vamos ao FTP para o sr. me ajudar ?

Não sou programador e preciso dessa loja funcionando com PagSeguro já que não tenho capital para custear esse serviço, estou iniciando nos negócios virtuais agora.

Agradeço.

MSN: andresouzatorres@yahoo.com.br

In Topic: Adodb.field Erro '80020009'

06/03/2009, 11:39

Tipo de Erro
ADO - 80020009


Descricao:
Inicio e Fim de Arquivos são verdadeiros, ou o registro atual foi cancelado.
A operação pedida requer um registro atual. Na maioria das vezes isso
acontece quando se tenta procurar um valor em um campo da Base de
Dados e a variável que é utilizada para realizar a pesquisa não contem
nenhum valor.


Colega, vc está tentando acessar o recordSet fora da verificação de registros, veja ai:

VarFrete = 0

Call AbreBanco

Set objPagamento = Banco.Execute("SELECT * FROM Pagamentos WHERE Cod = "& VarPagamento &"")

Set Pedidos = Banco.Execute("SELECT * FROM Pedidos WHERE Secao = '"& VarCliente &"'") 

Set Clientes = Banco.Execute("Select * From Clientes Where Cod = "& Pedidos("CodCliente") &"") '<-------------------------------------------

Set SomaTotal = Banco.Execute("Select SUM(PrecoTotal) AS SomaTotal FROM Pedidos WHERE Secao = '"& VarCliente &"'")
Inclua uma verificação ai. ;-)



Olá Meu amigo, obrigado pela manifestação, mas como ficaria ? você pode me ajudar ? me add no MSN andresouzatorres@yahoo.com.br acertando isso disponho do código da loja para você, abraços.

In Topic: Adodb.field Erro '80020009'

05/03/2009, 23:45

Passo por um problema com esse erro.

Olá Galera,
Não sou programador e por isso estou aqui para suplicar ajuda de vocês.

Possuo uma loja virtual em ASP + ACCESS e estou com dificuldade de bisbilhotar e implantar o PagSeguro nela.

Vamos ao problema.

Fui ao Banco e Criei a tabela para a forma de pagamento numero 7 (PagSeguro) e a habilitei.

Fiz o arquivo PagSeguro.asp dentro da pasta pagamentos com o seguinte código:

<table width="50%"  border="0" align="center" cellpadding="1" cellspacing="2">
<form target="pagseguro" action="https://pagseguro.uol.com.br/security/webpagamentos/webpagto.aspx" method="post">
  <tr>
	<td width="100%" height="46" class="TextTahoma11AzulBold"><div align="center">
	<input type="hidden" name="email_cobranca" value="suporte@lojamodelo.com.br" />
	<input type="hidden" name="tipo" value="CP" />
	 <input type="hidden" name="moeda" value="BRL" />
	<input type="hidden" name="cliente_nome" value="<%=Clientes("Nome")%>">
	<input type="hidden" name="cliente_end" value="<%=Clientes("Endereco")%>">
	<input type="hidden" name="cliente_bairro" value="<%=Clientes("Bairro")%>">
	<input type="hidden" name="cliente_cidade" value="<%=Clientes("Cidade")%>">
	<input type="hidden" name="cliente_uf" value="<%=Clientes("Estado")%>">
	<input type="hidden" name="cliente_cep" value="<%=Clientes("CEP")%>">
	<input type="hidden" name="item_valor_1" value="<%=FormatCurrency(SomaTotal("SomaTotal") + SomaFrete("SomaFrete") + VarValorBase)%>">
	<input type="hidden" name="item_descr_1" value="<%=Pedidos("Produto")%>" />
	<input type="image" src="https://pagseguro.uol.com.br/Security/Imagens/btnfinalizaBR.jpg" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" />
	
	</div></td>
  </tr>
</form>
</table>

Até aí beleza, a página que o cliente escolhe qual forma de pagamento (recibo.asp) vai usar é esta:

<!--#include file="Includes/Config.asp"-->
<link href="Includes/Styles.css" rel="stylesheet" type="text/css">

<%

Dim Pedidos
Dim Linha
Dim VarCliente
Dim SomaTotal
Dim Frete
Dim Regioes
Dim Regiao
Dim VarAct
Dim VarFrete
Dim VarMethod
Dim Clientes
Dim VarPagamento
Dim objPagamento
Dim objPedidosFinalizados
Dim SomaFrete
Dim VarValorTotalFinalizado
Dim VarValorBase
Dim Corpo
Dim objPedidos

VarAct = Request.QueryString("Act")
VarCliente = Session.SessionID
VarPagamento = Request.QueryString("Pagamento")

VarFrete = 0

Call AbreBanco

Set objPagamento = Banco.Execute("SELECT * FROM Pagamentos WHERE Cod = "& VarPagamento &"")

Set Pedidos = Banco.Execute("SELECT * FROM Pedidos WHERE Secao = '"& VarCliente &"'")

Set Clientes = Banco.Execute("Select * From Clientes Where Cod = "& Pedidos("CodCliente") &"")

Set SomaTotal = Banco.Execute("Select SUM(PrecoTotal) AS SomaTotal FROM Pedidos WHERE Secao = '"& VarCliente &"'")

Set SomaFrete = Banco.Execute("Select SUM(Frete) AS SomaFrete FROM Pedidos WHERE Secao = '"& VarCliente &"'")

VarValorBase = Pedidos("ValorBase")

VarValorTotalFinalizado = Replace(Replace(SomaTotal("SomaTotal") + SomaFrete("SomaFrete") + VarValorBase,".",""),",",".")

Set objPedidosFinalizados = Banco.Execute("INSERT INTO PedidosFinalizados (Valor, CodCliente, FormaPagamento, CodSecao) VALUES ('"& VarValorTotalFinalizado &"', "& Clientes("Cod") &", "& VarPagamento &", "& VarCliente &")")

Set objPedidos = Banco.Execute("SELECT * FROM PedidosFinalizados WHERE CodSecao = '"& VarCliente &"'")

Set AltPedidos = Banco.Execute("UPDATE Pedidos SET CodFinalizado = "& objPedidos("Cod") &" WHERE Secao = '"& VarCliente &"'")

Corpo = "<link href="& Chr(34) & Local & "Includes/Styles.css"& Chr(34) &" rel="& Chr(34) &"stylesheet"& Chr(34) &" type="& Chr(34) &"text/css"& Chr(34) &">"
Corpo = Corpo & "<br><span class="& Chr(34) &"TextTahoma11Cinza"& Chr(34) &"> Pedido feito no dia: </span><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &">"& Date() &" </span><span class="& Chr(34) &"TextTahoma11Cinza"& Chr(34) &">/ Nº do Pedido: </span><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"> "& objPedidos("Cod") &"</span><br><br>"
Corpo = Corpo & "<span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"> Dados do Cliente</span><br>"
Corpo = Corpo & "<span class="& Chr(34) &"TextTahoma11Cinza"& Chr(34) &"> Nome do Cliente: </span><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"> "& Clientes("Nome") &"<br></span>"
Corpo = Corpo & "<span class="& Chr(34) &"TextTahoma11Cinza"& Chr(34) &"> E-mail do Cliente: </span><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"> "& Clientes("Email") &"<br></span>"
Corpo = Corpo & "<span class="& Chr(34) &"TextTahoma11Cinza"& Chr(34) &"> Telefone do Cliente: </span><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"> ("& Clientes("DDDTelefone") &") "& Clientes("Telefone") &" / ("& Clientes("DDDCelular") &") "& Clientes("Celular") &"</span>"

If ComponenteEmail = 1 Then
								
	Dim Contato
	Set Contato = Server.CreateObject("CDONTS.NewMail")
		Contato.From = Clientes("Nome") & "<"& Clientes("Email") &">"
		Contato.To = EmailContato
		Contato.Subject = "Um novo pedido foi feito na - " & NomedaLoja
		Contato.BodyFormat = 0
		Contato.MailFormat = 0
		Contato.Body = Corpo
		Contato.Send
	Set Contato = Nothing
								
Else
								
	Dim Mailer
	Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
		Mailer.RemoteHost  = ServerAddress
		Mailer.FromName	= Clientes("Nome")
		Mailer.FromAddress = Clientes("Email")
		Mailer.AddRecipient EmailContato, NomedaLoja
		Mailer.Subject	 = "Um novo pedido foi feito na - " & NomedaLoja
		Mailer.BodyText	= Corpo
		Mailer.SendMail
									
	Set Mailer = Nothing
	
End If
							
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
	<td><!--#include file="Includes/BarraCima.asp"--></td>
  </tr>
  <tr>
	<td>
		<table width="100%"  border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="176" height="100%" valign="top"><!--#include file="Includes/BarraEsq.asp"--></td>
				<td width="0" valign="top">
					<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td height="9%" align="center"><img src="Imagens/SpacerCima.gif" width="1" height="9"></td>
						</tr>
						<%If VarAct = "" Then%>
		 				<tr>
		 				  <td height="20" align="center" bgcolor="<%=FundoTitulo%>"><div align="left">  <span class="TextTahoma11AzulBold">Recibo do Pedido</span></div></td>
	   				  </tr>
		 				<tr>
							<td height="9%" align="center"> </td>
						  </tr>
		 				<tr>
		 				  <td height="10%" align="center"><table width="64%"  border="0" align="center" cellpadding="1" cellspacing="2">
							<tr>
							  <td width="100%" class="TextTahoma11AzulBold"><div align="center">Local da entrega </div></td>
							</tr>
							<tr>
							  <td class="TextTahoma11Cinza"><div align="center" class="TextTahoma11Cinza"><%=Pedidos("Entrega")%></div></td>
							</tr>
							<tr>
							  <td height="6" class="TextTahoma11Cinza"></td>
							</tr>
							<tr>
							  <td height="1" bgcolor="e5e5e5" class="TextTahoma11Cinza"></td>
							</tr>
						  </table></td>
	   				  </tr>
		 				<tr>
		 				  <td height="19%" align="center"> </td>
	   				  </tr>
						  <tr>
							<td height="0" align="center" valign="middle">
						<%
						
						If Pedidos.EOF Then
							  Response.Write "<center><span class="& Chr(34) &"TextTahoma11CinzaBold"& Chr(34) &"><br>Seu carrinho de compras está vazio.</span></center><br><br>" & Voltar
						Else
						  
						%>
						  <table  border="0" bgcolor="#FFFFFF">
							<tr bgcolor="<%=TabelaBarraEsq%>">
							  <td width="7%" height="20" align="center"><span class="TextTahoma11CinzaBold">Qtd</span></td>
							  <td height="20"><div align="center"><span class="TextTahoma11CinzaBold">Nome</span></div></td>
							  <td width="15%" height="20"><div align="center"><span class="TextTahoma11CinzaBold">Valor unit.</span></div></td>
							  <td width="16%" height="20" align="center"><div align="center"><span class="TextTahoma11CinzaBold">Sub-Total</span></div></td>
							</tr>
							<%
							
							Dim VarSubTotal
							
							WHILE NOT Pedidos.EOF
							
							VarSubTotal = Pedidos("Preco") * Pedidos("Quantidade")
							
							Dim Produtos
							Set Produtos = Banco.Execute("Select * From Produtos Where Cod="& Pedidos("CodProduto"))
							
							Banco.Execute("Update Produtos Set Estoque='"& Produtos("Estoque") - Pedidos("Quantidade") &"' Where Cod="& Produtos("Cod"))
							
							If Linha Then
							
							%>
								<tr bgcolor="<%=FundoCelula1%>">
							  <%
							
							End If : Linha = not Linha
							
							%>							  
							  <td height="20" align="center" class="TextTahoma11Cinza"><a href="MaisProduto.asp?Produto=<%=Pedidos("CodProduto")%>" class="LinkTahoma11Cinza"><%=Pedidos("Quantidade")%></a></td>
							  <td height="20"><span class="TextTahoma11Cinza"> </span><a href="MaisProduto.asp?Produto=<%=Pedidos("CodProduto")%>" class="LinkTahoma11Cinza"><%=Pedidos("Produto")%></a></td>
							  <td height="20"><div align="center"><span class="TextTahoma11Cinza"><%=FormatCurrency(Pedidos("Preco"))%></span></div></td>
							  <td height="20" align="center"><div align="right"><span class="TextTahoma11Cinza"><%=FormatCurrency(VarSubTotal)%> </span></div></td>
							</tr>
							<%
							
							Pedidos.MOVENEXT : WEND
							
							%>
							<tr bgcolor="#FFFFFF">
							  <td height="6" colspan="4" class="TextTahoma11Cinza"></td>
							</tr>
							<tr bgcolor="#FFFFFF">
							  <td height="1" colspan="4" bgcolor="e5e5e5" class="TextTahoma11Cinza"></td>
							</tr>
							<tr bgcolor="#FFFFFF">
							  <td height="6" colspan="4" class="TextTahoma11Cinza"></td>
							</tr>
							<tr bgcolor="#FFFFFF">
							  <td height="20" colspan="2" class="TextTahoma11Cinza"><div align="right">Valor do frete: <span class="TextTahoma11CinzaBold"></span></div></td>
							  <td height="20" colspan="2"><div align="right"><span class="TextTahoma11Cinza"><%=FormatCurrency(SomaFrete("SomaFrete") + VarValorBase)%></span></div></td>
							</tr>
							<tr bgcolor="#FFFFFF">
							  <td height="20" colspan="2">
								<div align="right"><span class="TextTahoma11CinzaBold">Valor total</span></div></td>
							  <td height="20" colspan="2"><div align="right"><span class="TextArial18CinzaBold"><%=FormatCurrency(SomaTotal("SomaTotal") + SomaFrete("SomaFrete") + VarValorBase)%></span></div></td>
							</tr>
							<tr bgcolor="#FFFFFF">
							  <td height="20" colspan="2"><div align="right" class="TextTahoma11Cinza">Forma de Pagamento: 
								</div></td>
							  <td height="20" colspan="2" class="TextTahoma11CinzaBold"><div align="right"><%=objPagamento("Forma")%></div></td>
							</tr>
							<tr>
							  <td height="6" colspan="4" class="TextTahoma11Cinza"></td>
							</tr>
							<tr>
							  <td height="1" colspan="4" bgcolor="e5e5e5" class="TextTahoma11Cinza"></td>
							</tr>
							<tr>
							  <td height="6" colspan="4" class="TextTahoma11Cinza"></td>
							</tr>
						  </table>
						<%
						
						End If
						
						%></td>
	   				  </tr>
						  <tr>
							<td height="0" align="center" valign="middle"> </td>
	   				  </tr>
						  <tr>
							<td height="0" align="center" valign="middle">
						  <%If VarPagamento = "1" Then%>
						  <!--#include file="Pagamento/Deposito.asp" -->
						  <%ElseIf VarPagamento = "2" Then%>
						  <!--#include file="Pagamento/BoletoItau.asp" -->
						  <%ElseIf VarPagamento = "3" Then%>
						  <!--#include file="Pagamento/BoletoBradesco.asp" -->
						  <%ElseIf VarPagamento = "4" Then%>
						  <!--#include file="Pagamento/BoletoCaixa.asp" -->
						  <%ElseIf VarPagamento = "5" Then%>
						  <!--#include file="Pagamento/BoletoBB.asp" -->
						  <%ElseIf VarPagamento = "6" Then%>
						  <!--#include file="Pagamento/BoletoReal.asp" -->
						  <%ElseIf VarPagamento = "7" Then%>
						  <!--#include file="Pagamento/PagSeguro.asp" -->
						  <%End If%>
						  </td>
	   				  </tr>
					  <tr>
						  <td> </td>
					  </tr>
						  <%=LinhaHorizontal%>
						  <tr>
							<td height="25" align="center" valign="middle"><a href="<%=Local%>" class="LinkTahoma11CinzaBold">Sair e continuar navegando</a></td>
	   				  </tr>
						  <%=LinhaHorizontal%>
					  <%End If%>
					</table>
				</td>
				<td width="148" height="100%" valign="top"><!--#include file="Includes/BarraDir.asp"--></td>
			  </tr>
   	  </table>
	</td>
  </tr>
  <tr>
	<td><!--#include file="Includes/Rodape.asp"--></td>
  </tr>
</table>
<%

Banco.Execute("Update Pedidos Set Secao=0 Where Secao = '"&VarCliente&"'")
Session.Abandon()

Set objPagamento = Nothing
Set Pedidos = Nothing
Set Clientes = Nothing
Set SomaTotal = Nothing
Set SomaFrete = Nothing
Set objPedidosFinalizados = Nothing
Set objPedidos = Nothing
Set AltPedidos = Nothing

Call FechaBanco

%>

Notem que o arquivo PagSeguro.asp está em include que se estiver habilitado ele irá aparecer, o que é o caso, porém onde deveria aparecer o botao do pagseguro para enviar via POST os dados, acontece isto:

ADODB.Field erro '80020009'

BOF ou EOF são verdadeiros, ou o registro atual foi excluído. A operação solicitada pelo aplicativo requer um registro atual.

/ganhetempo/Recibo.asp, line 0

Alguém pode me da a solução URGENTEMENTE ??????

IPB Skin By Virteq