Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Aprendendo

Microsoft JET Database Engine error '800

Recommended Posts

Sou super iniciante, e preciso de uma ajuda bem detalhada.

 

Fiz upload de umna loja virtual e está dando o seguinte erro:

Microsoft JET Database Engine error '80040e07'

 

Data type mismatch in criteria expression.

 

/index.asp, line 309

 

e na linha 309-

 

Set objRS_verifica = objCon.Execute(ComandoSQL)

 

Alguem poderia me ajudar...

Obrigadão Pessoal

http://forum.imasters.com.br/public/style_emoticons/default/joia.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

esse erro é que você tá passando uma string para um integer, ou algo do gênero...verifique o ComandoSQL. se não achar erro, poste ele aqui...[]s

<%Response.Write "<table border=0 align=center cellpadding=0 cellspacing=0 class=pagina>"Response.Write " <tr>"Response.Write " <td>"%><!--#include file="topo.asp"--><%Response.Write " </td>"Response.Write " </tr>"Response.Write " <tr>"Response.Write " <td>"RegPorPag = Application("te_produtos_pagina")VarPagMax = 10Set objCon = Server.CreateObject("ADODB.Connection")objCon.Open Application("te_conexao")If Application("te_alinhamento_secoes") = 2 And Application("te_alinhamento_categorias") = 2 And Application("te_alinhamento_subcategorias") = 1 Then Response.Write "<table border=0 align=center cellpadding=0 cellspacing=0 width='100%'>" Response.Write " <tr>" Response.Write " <td width='1%'><a href='index.asp'><img src='imagens/antes_secoes.gif' border=0></a></td>" Response.Write " <td class='menu_secoes'>"%><!--#include file="exibe_secoes.asp"--><% Response.Write " <td width='1%'><a href='index.asp'><img src='imagens/depois_secoes.gif' border=0></a></td>" Response.Write " </tr>" If Request("secao") <> "" Then Response.Write " <tr>" Response.Write " <td width='1%'><a href='index.asp'><img src='imagens/antes_categorias.gif' border=0></a></td>" Response.Write " <td>"%><!--#include file="exibe_categorias.asp"--><% Response.Write " </td>" Response.Write " <td width='1%'><a href='index.asp'><img src='imagens/depois_categorias.gif' border=0></a></td>" Response.Write " </tr>" End If If Application("te_exibe_busca") = 1 Then Response.Write " <tr>" Response.Write " <td colspan=3>"%><!--#include file="exibe_busca.asp"--><% Response.Write " </td>" Response.Write " </tr>" End If Response.Write " <tr valign='top'>" Response.Write " <td width='1%'>" Response.Write " <table border=0 cellspacing=0 cellpadding=0 width='100%'>" If Request("categoria") <> "" Then%><!--#include file="exibe_subcategorias.asp"--><% End If If Application("te_le_posicao") = "t" Then Response.Write " <tr>" Response.Write " <td class=texto colspan=2>" Response.Write Application("te_lateral_esquerda") Response.Write " </td>" Response.Write " </tr>" End If If Application("te_exibe_fabricantes") = True Then Response.Write " <tr>" Response.Write " <td colspan=2><img src='imagens/antes_fabricantes.gif'></td>" Response.Write " </tr>" Response.Write " <tr>" Response.Write " <td colspan=2 class='menu_fabricantes'>"%><!--#include file="exibe_fabricantes.asp"--><% Response.Write " </td>" Response.Write " <tr>" Response.Write " <td colspan=2><img src='imagens/depois_fabricantes.gif'></td>" Response.Write " </tr>" End If If Request("secao") = "" Then ComandoSQL = "SELECT COUNT(*) as total FROM secoes WHERE sortear_produtos_mais_vendidos = 1" Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_mais_vendidos = True Else exibe_mais_vendidos = False If exibe_mais_vendidos = True Then Response.Write " <tr>" Response.Write " <td>" Response.Write " <table border=0 align=center cellpadding=0 cellspacing=0 width='100%' class=texto>" Response.Write " <tr><td><img src='imagens/antes_mais_vendidos.gif' border=0></td></tr>" Response.Write " <tr><td>"%><!--#include file="exibe_produtos_mais_vendidos.asp"--><% Response.Write " </td></tr>" Response.Write " <tr><td><img src='imagens/depois_mais_vendidos.gif' border=0></td></tr>" Response.Write " </table>" Response.Write " </td>" Response.Write " </tr>" End If End If If Application("te_le_posicao") = "b" Then Response.Write " <tr>" Response.Write " <td colspan=2 class=texto>" Response.Write Application("te_lateral_esquerda") Response.Write " </td>" Response.Write " </tr>" End If Response.Write " </table>" Response.Write " </td>" Response.Write " <td>"%><%If Application("te_exibe_busca") = 0 Then %><!--#include file="exibe_busca.asp"--><%End If%><%If Request("id") <> "" Then%><!--#include file="exibe_detalhes_produtos.asp"--><%ElseIf Request("shop") <> "" Then%><!--#include file="shop.asp"--><%ElseIf Request("secao") = "" Then%><!--#include file="index_exibe_produtos.asp"--><%ElseIf Request("secao") <> "" And Request("categoria") = "" Then%><!--#include file="secoes_exibe_produtos.asp"--><%Else%><!--#include file="exibe_produtos.asp"--><%End If%><% Response.Write " </td>" If Application("te_menu_direita") = 1 And Request("id") = "" Then Response.Write "<td width='1%' valign='top' class='menu_direita'>" If Application("te_ld_posicao") = "t" Then Response.Write Application("te_lateral_direita") End If If Request("secao") <> "" AND Request("secao") <> "0" Then ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND secao = " & Request("secao") & " AND promocao_inicio <= '" & Date() & "' AND promocao_final >= '" & Date() & "'" Else ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND promocao_inicio <= '" & Date() & "' AND promocao_final >= '" & Date() & "'" End If Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_promocoes = True Else exibe_promocoes = False If Request("secao") <> "" AND Request("secao") <> "0" Then ComandoSQL = "SELECT COUNT(*) as total FROM categorias WHERE sortear_produtos_promocao = 1 AND id_secao = " & Request("secao") Else ComandoSQL = "SELECT COUNT(*) as total FROM secoes WHERE sortear_produtos_promocao = 1" End If Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_promocoes = True Else exibe_promocoes = False If exibe_promocoes = True Then Response.Write "<table border=0 align='center' cellpadding=0 cellspacing=0 width='100%' class='texto'>" Response.Write " <tr><td><img src='imagens/antes_em_promocao.gif' border=0></td></tr>" If Request("secao") <> "" AND Request("secao") <> "0" Then Response.Write " <tr><td>"%><!--#include file="secoes_exibe_produtos_em_promocao.asp"--><% Response.Write " </td></tr>" Else Response.Write " <tr><td>"%><!--#include file="index_exibe_produtos_em_promocao.asp"--><% Response.Write " </td></tr>" End If Response.Write " <tr><td><img src='imagens/depois_em_promocao.gif' border=0></td></tr>" Response.Write "</table>" End If If Application("te_ld_posicao") = "b" Then Response.Write Application("te_lateral_direita") End If Response.Write "</td>" End If Response.Write " </tr>" Response.Write "</table>"ElseIf Application("te_alinhamento_secoes") = 2 And Application("te_alinhamento_categorias") = 1 And Application("te_alinhamento_subcategorias") = 1 Then Response.Write "<table border=0 align=center cellpadding=0 cellspacing=0 width='100%' class='texto'>" Response.Write " <tr>" Response.Write " <td width='1%'><a href='index.asp'><img src='imagens/antes_secoes.gif' border=0></a></td>" Response.Write " <td style='width:100%' class='menu_secoes'>"%><!--#include file="exibe_secoes.asp"--><% Response.Write " </td>" Response.Write " <td width='1%'><img src='imagens/depois_secoes.gif' border=0></td>" Response.Write " </tr>" Response.Write "</table>" Response.Write "<table border=0 align='center' cellpadding=0 cellspacing=0 width='100%' class='texto'>" If Application("te_exibe_busca") = 1 Then Response.Write " <tr>" Response.Write " <td colspan=3>"%><!--#include file="exibe_busca.asp"--><% Response.Write " </td>" Response.Write " </tr>" End If Response.Write " <tr valign=top>" Response.Write " <td width='1%'>" Response.Write " <table border=0 cellspacing=0 cellpadding=0 width='1%'>" If Application("te_le_posicao") = "t" Then Response.Write " <tr>" Response.Write " <td class=texto>" Response.Write Application("te_lateral_esquerda") Response.Write " </td>" Response.Write " </tr>" End If If Request("secao") <> "" Then Response.Write " <tr>" Response.Write " <td><img src='imagens/antes_categorias.gif'></td>" Response.Write " </tr>" Response.Write " <tr>" Response.Write " <td class='menu_categorias'>"%><!--#include file="exibe_categorias.asp"--><% Response.Write " </td>" Response.Write " </tr>" Response.Write " <tr>" Response.Write " <td><img src='imagens/depois_categorias.gif'></td>" Response.Write " </tr>" Else ComandoSQL = "SELECT COUNT(*) as total FROM secoes WHERE sortear_produtos_mais_vendidos = 1" Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_mais_vendidos = True Else exibe_mais_vendidos = False If exibe_mais_vendidos = True Then Response.Write " <tr>" Response.Write " <td>" Response.Write " <table border=0 align=center cellpadding=0 cellspacing=0 width='100%' class=texto>" Response.Write " <tr><td><img src='imagens/antes_mais_vendidos.gif' border=0></td></tr>" Response.Write " <tr><td>"%><!--#include file="exibe_produtos_mais_vendidos.asp"--><% Response.Write " </td></tr>" Response.Write " <tr><td><img src='imagens/depois_mais_vendidos.gif' border=0></td></tr>" Response.Write " </table>" Response.Write " </td>" Response.Write " </tr>" End If End If If Application("te_exibe_fabricantes") = True Then Response.Write " <tr><td><img src='imagens/antes_fabricantes.gif'></td></tr>" Response.Write " <tr><td class='menu_fabricantes'>"%><!--#include file="exibe_fabricantes.asp"--><% Response.Write " </td></tr>" Response.Write " <tr><td><img src='imagens/depois_fabricantes.gif'></td></tr>" End If If Application("te_le_posicao") = "b" Then Response.Write " <tr>" Response.Write " <td class=texto>" Response.Write Application("te_lateral_esquerda") Response.Write " </td>" Response.Write " </tr>" End If Response.Write " </table>" Response.Write " </td>" Response.Write " <td valign='top'>"%><%If Application("te_exibe_busca") = 0 Then %><!--#include file="exibe_busca.asp"--><%End If%><%If Request("id") <> "" Then%><!--#include file="exibe_detalhes_produtos.asp"--><%ElseIf Request("shop") <> "" Then%><!--#include file="shop.asp"--><%ElseIf Request("secao") = "" Then%><!--#include file="index_exibe_produtos.asp"--><%ElseIf Request("secao") <> "" And Request("categoria") = "" Then%><!--#include file="secoes_exibe_produtos.asp"--><%Else%><!--#include file="exibe_produtos.asp"--><%End If%><% Response.Write " </td>" If Application("te_menu_direita") = 1 And Request("id") = "" Then Response.Write "<td width='1%' valign='top' class='menu_direita'>" If Application("te_ld_posicao") = "t" Then Response.Write Application("te_lateral_direita") End If If Request("secao") <> "" AND Request("secao") <> "0" Then ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND secao = " & Request("secao") & " AND promocao_inicio <= '" & Date() & "' AND promocao_final >= '" & Date() & "'" Else ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND promocao_inicio <= '" & Date() & "' AND promocao_final >= '" & Date() & "'" End If Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_promocoes = True Else exibe_promocoes = False If Request("secao") <> "" AND Request("secao") <> "0" Then ComandoSQL = "SELECT COUNT(*) as total FROM categorias WHERE sortear_produtos_promocao = 1 AND id_secao = " & Request("secao") Else ComandoSQL = "SELECT COUNT(*) as total FROM secoes WHERE sortear_produtos_promocao = 1" End If Set objRS_verifica = objCon.Execute(ComandoSQL) If objRS_verifica("total") > 0 Then exibe_promocoes = True Else exibe_promocoes = False If exibe_promocoes = True Then Response.Write "<table border=0 align=center cellpadding=0 cellspacing=0 width='100%' class=texto>" Response.Write " <tr><td><img src='imagens/antes_em_promocao.gif' border=0></td></tr>" If Request("secao") <> "" AND Request("secao") <> "0" Then Response.Write "<tr><td>"%><!--#include file="secoes_exibe_produtos_em_promocao.asp"--><% Response.Write "</td></tr>" Else Response.Write "<tr><td>"%><!--#include file="index_exibe_produtos_em_promocao.asp"--><% Response.Write "</td></tr>" End If Response.Write " <tr><td><img src='imagens/depois_em_promocao.gif' border=0></td></tr>" Response.Write "</table>" End If If Application("te_ld_posicao") = "b" Then Response.Write Application("te_lateral_direita") End If Response.Write "</td>" End If Response.Write " </tr>" Response.Write "</table>"ElseIf Application("te_alinhamento_secoes") = 1 And Application("te_alinhamento_categorias") = 1 And Application("te_alinhamento_subcategorias") = 1 Then Response.Write "<table border=0 align=center cellpadding=0 cellspacing=0 width='100%'>" If Application("te_exibe_busca") = 1 Then Response.Write "<tr><td colspan=3>"%><!--#include file="exibe_busca.asp"--><% Response.Write "</td></tr>" Response.Write "" End If Response.Write "<tr><td width='20%' valign=top>"

Compartilhar este post


Link para o post
Compartilhar em outros sites
:o

 

pow mano... c bem q podia ajudar mais né... postar só a linha que deu erro... ou seja, só o "ComandoSQL" acima da linha do erro!

 

o campo "promocao_inicio" e "promocao_final" estão como texto ou como data no banco de dados????

 

se estiver como data, tente assim:

 

ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND promocao_inicio <= #" & Date() & "# AND promocao_final >= #" & Date() & "#"

 

:blink: :blink: :blink: :blink:

Poxa Bicicleta me desculpa.

E como eu falei eu sou muito iniciante.

Olha so eu fiz a alteração conforme você.indicou e nada, ai piorou deu http500

 

está abaixo exatamente a linha anterios e posterior ao erro.

 

If Request("secao") <> "" AND Request("secao") <> "0" Then

ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND secao = " & Request("secao") & " AND promocao_inicio <= '" & Date() & "' AND promocao_final >= '" & Date() & "'"

Else

ComandoSQL = "SELECT COUNT(*) as total FROM produtos WHERE exibir = 1 AND promocao_inicio <= #" & Date() & "# AND promocao_final >= #" & Date() & "#"

End If

Set objRS_verifica = objCon.Execute(ComandoSQL)

If objRS_verifica("total") > 0 Then exibe_promocoes = True Else exibe_promocoes = False

 

Valeu

:rolleyes:

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.