Ir para conteúdo
Fórum Script Brasil
  • 0

Erro Na Conexão Bd


graciane2004

Pergunta

huh.gif Estou arrumando um site q está c/ um erro estranho, quando se faz a busca por classificados, se ele não acha nenhum (não tem nenhum cadastado) não dá erro nenhum, mas p/ todos os que tem classificados cadastrados no bd, aparece esse erro abaixo, o q será? o código está logo abaixo do erro:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.

More information about this error may be available in the server error log

1ª PARTE

<%@LANGUAGE="VBSCRIPT"%>

<!--#include file="../Connections/connSobraci.asp" -->

<%

Dim rsConsulta__vArea

rsConsulta__vArea = "A"

if (Request.QueryString("Area") <> "") then rsConsulta__vArea = Request.QueryString("Area")

%>

<%

set rsConsulta = Server.CreateObject("ADODB.Recordset")

rsConsulta.ActiveConnection = MM_connSobraci_STRING

rsConsulta.Source = "SELECT * FROM tClassificados WHERE Area = '" + Replace(rsConsulta__vArea, "'", "''") + "'"

rsConsulta.CursorType = 0

rsConsulta.CursorLocation = 2

rsConsulta.LockType = 3

rsConsulta.Open()

rsConsulta_numRows = 0

%>

<%

Dim Repeat1__numRows

Repeat1__numRows = -1

Dim Repeat1__index

Repeat1__index = 0

rsConsulta_numRows = rsConsulta_numRows + Repeat1__numRows

%>

<%

' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count

rsConsulta_total = rsConsulta.RecordCount

' set the number of rows displayed on this page

If (rsConsulta_numRows < 0) Then

rsConsulta_numRows = rsConsulta_total

Elseif (rsConsulta_numRows = 0) Then

rsConsulta_numRows = 1

End If

' set the first and last displayed record

rsConsulta_first = 1

rsConsulta_last = rsConsulta_first + rsConsulta_numRows - 1

' if we have the correct record count, check the other stats

If (rsConsulta_total <> -1) Then

If (rsConsulta_first > rsConsulta_total) Then rsConsulta_first = rsConsulta_total

If (rsConsulta_last > rsConsulta_total) Then rsConsulta_last = rsConsulta_total

If (rsConsulta_numRows > rsConsulta_total) Then rsConsulta_numRows = rsConsulta_total

End If

%>

<%

' *** Recordset Stats: if we don't know the record count, manually count them

If (rsConsulta_total = -1) Then

' count the total records by iterating through the recordset

rsConsulta_total=0

While (Not rsConsulta.EOF)

rsConsulta_total = rsConsulta_total + 1

rsConsulta.MoveNext

Wend

' reset the cursor to the beginning

If (rsConsulta.CursorType > 0) Then

rsConsulta.MoveFirst

Else

rsConsulta.Requery

End If

' set the number of rows displayed on this page

If (rsConsulta_numRows < 0 Or rsConsulta_numRows > rsConsulta_total) Then

rsConsulta_numRows = rsConsulta_total

End If

' set the first and last displayed record

rsConsulta_first = 1

rsConsulta_last = rsConsulta_first + rsConsulta_numRows - 1

If (rsConsulta_first > rsConsulta_total) Then rsConsulta_first = rsConsulta_total

If (rsConsulta_last > rsConsulta_total) Then rsConsulta_last = rsConsulta_total

End If

%>

<html>

2ª PARTE

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><font face="Arial" size="2">Classificado de <b><%=Request("Area")%></b></font></td>

</tr>

<tr>

<td height="30" valign="top"><font size="1" face="Verdana">Total

de <b><%=(rsConsulta_total)%></b> encontrado(s)</font></td>

</tr>

<tr>

<td>

<% If Not rsConsulta.EOF Or Not rsConsulta.BOF Then %>

<%

While ((Repeat1__numRows <> 0) AND (NOT rsConsulta.EOF))

%>

<table width="90%" border="0" cellspacing="0" cellpadding="3" align="center">

<tr>

<td bgcolor="#FFFF99"><b><font face="Arial" size="2"><%=(rsConsulta.Fields.Item("Nome").Value)%></font></b></td>

</tr>

<tr>

<td>

<p><font face="Arial" size="2" color="#999999">End.: </font><font face="Arial" size="2"><%=(rsConsulta.Fields.Item("EnderecoRes").Value)%>- <%=(rsConsulta.Fields.Item("CEP").Value)%> - <%=(rsConsulta.Fields.Item("Cidade").Value)%> - <%=(rsConsulta.Fields.Item("Estado").Value)%><br>

<font color="#999999">Fone:</font> <%=(rsConsulta.Fields.Item("Telefone").Value)%></font><br>

<font face="Arial" size="2" color="#999999">Descritivo:</font><font face="Arial" size="2">

<%=(rsConsulta.Fields.Item("Descritivo").Value)%></font></p>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

</table>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

rsConsulta.MoveNext()

Wend

%>

<% End If ' end Not rsConsulta.EOF Or NOT rsConsulta.BOF %>

</td>

</tr>

</table>

Se alguém puder me ajudar, agradeço muito

abraços

Graciane

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0
huh.gif Estou arrumando um site q está c/ um erro estranho, quando se faz a busca por classificados, se ele não acha nenhum (não tem nenhum cadastado) não dá erro nenhum, mas p/ todos os que tem classificados cadastrados no bd, aparece esse erro abaixo, o q será? o código está logo abaixo do erro:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred and anything you might have done that may have caused the error.

More information about this error may be available in the server error log

1ª PARTE

<%@LANGUAGE="VBSCRIPT"%>

<!--#include file="../Connections/connSobraci.asp" -->

<%

Dim rsConsulta__vArea

rsConsulta__vArea = "A"

if (Request.QueryString("Area") <> "") then rsConsulta__vArea = Request.QueryString("Area")

%>

<%

set rsConsulta = Server.CreateObject("ADODB.Recordset")

rsConsulta.ActiveConnection = MM_connSobraci_STRING

rsConsulta.Source = "SELECT * FROM tClassificados WHERE Area = '" + Replace(rsConsulta__vArea, "'", "''") + "'"

rsConsulta.CursorType = 0

rsConsulta.CursorLocation = 2

rsConsulta.LockType = 3

rsConsulta.Open()

rsConsulta_numRows = 0

%>

<%

Dim Repeat1__numRows

Repeat1__numRows = -1

Dim Repeat1__index

Repeat1__index = 0

rsConsulta_numRows = rsConsulta_numRows + Repeat1__numRows

%>

<%

' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count

rsConsulta_total = rsConsulta.RecordCount

' set the number of rows displayed on this page

If (rsConsulta_numRows < 0) Then

rsConsulta_numRows = rsConsulta_total

Elseif (rsConsulta_numRows = 0) Then

rsConsulta_numRows = 1

End If

' set the first and last displayed record

rsConsulta_first = 1

rsConsulta_last = rsConsulta_first + rsConsulta_numRows - 1

' if we have the correct record count, check the other stats

If (rsConsulta_total <> -1) Then

If (rsConsulta_first > rsConsulta_total) Then rsConsulta_first = rsConsulta_total

If (rsConsulta_last > rsConsulta_total) Then rsConsulta_last = rsConsulta_total

If (rsConsulta_numRows > rsConsulta_total) Then rsConsulta_numRows = rsConsulta_total

End If

%>

<%

' *** Recordset Stats: if we don't know the record count, manually count them

If (rsConsulta_total = -1) Then

' count the total records by iterating through the recordset

rsConsulta_total=0

While (Not rsConsulta.EOF)

rsConsulta_total = rsConsulta_total + 1

rsConsulta.MoveNext

Wend

' reset the cursor to the beginning

If (rsConsulta.CursorType > 0) Then

rsConsulta.MoveFirst

Else

rsConsulta.Requery

End If

' set the number of rows displayed on this page

If (rsConsulta_numRows < 0 Or rsConsulta_numRows > rsConsulta_total) Then

rsConsulta_numRows = rsConsulta_total

End If

' set the first and last displayed record

rsConsulta_first = 1

rsConsulta_last = rsConsulta_first + rsConsulta_numRows - 1

If (rsConsulta_first > rsConsulta_total) Then rsConsulta_first = rsConsulta_total

If (rsConsulta_last > rsConsulta_total) Then rsConsulta_last = rsConsulta_total

End If

%>

<html>

2ª PARTE

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td><font face="Arial" size="2">Classificado de <b><%=Request("Area")%></b></font></td>

</tr>

<tr>

<td height="30" valign="top"><font size="1" face="Verdana">Total

de <b><%=(rsConsulta_total)%></b> encontrado(s)</font></td>

</tr>

<tr>

<td>

<% If Not rsConsulta.EOF Or Not rsConsulta.BOF Then %>

<%

While ((Repeat1__numRows <> 0) AND (NOT rsConsulta.EOF))

%>

<table width="90%" border="0" cellspacing="0" cellpadding="3" align="center">

<tr>

<td bgcolor="#FFFF99"><b><font face="Arial" size="2"><%=(rsConsulta.Fields.Item("Nome").Value)%></font></b></td>

</tr>

<tr>

<td>

<p><font face="Arial" size="2" color="#999999">End.: </font><font face="Arial" size="2"><%=(rsConsulta.Fields.Item("EnderecoRes").Value)%>- <%=(rsConsulta.Fields.Item("CEP").Value)%> - <%=(rsConsulta.Fields.Item("Cidade").Value)%> - <%=(rsConsulta.Fields.Item("Estado").Value)%><br>

<font color="#999999">Fone:</font> <%=(rsConsulta.Fields.Item("Telefone").Value)%></font><br>

<font face="Arial" size="2" color="#999999">Descritivo:</font><font face="Arial" size="2">

<%=(rsConsulta.Fields.Item("Descritivo").Value)%></font></p>

</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

</tr>

</table>

<%

Repeat1__index=Repeat1__index+1

Repeat1__numRows=Repeat1__numRows-1

rsConsulta.MoveNext()

Wend

%>

<% End If ' end Not rsConsulta.EOF Or NOT rsConsulta.BOF %>

</td>

</tr>

</table>

Se alguém puder me ajudar, agradeço muito

abraços

Graciane

Moderadores, Podem fechar o tópico, consegui arrumar !!!

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.


  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...