Porém há dias que não haverá informações para serem exibidas.
Nesse caso, como fazer para exibir uma frase no lugar dessa informação?
Posted 06/08/2007, 09:03
Posted 06/08/2007, 10:17
<%
If RECORDSET.eof Or RECORDSET.bof Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>OBS.: Troque "RECORDSET" pela tag do recordset que dá conexão com seu banco de dados, rs
Edição feita por: Humberto - S.O.S., 06/08/2007, 10:19.
Posted 06/08/2007, 16:53
<%
If Noticias.eof Or Noticias.bof Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>Script error detected at line 14.
Source line: If Noticias.eof Or Noticias.bof Then
Description: Objeto necessário: ''
Posted 06/08/2007, 17:01
<%
If Noticias.EOF And Noticias.BOF Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>Posted 07/08/2007, 08:21
<%
If NoticiasHJ.EOF And NoticiasHJ.BOF Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>
<%
Dim NoticiasHJ
Dim NoticiasHJ_cmd
Dim NoticiasHJ_numRows
Set NoticiasHJ_cmd = Server.CreateObject ("ADODB.Command")
NoticiasHJ_cmd.ActiveConnection = MM_CadNoticias_STRING
NoticiasHJ_cmd.CommandText = "SELECT * FROM Noticias WHERE [DATA] = date()"
NoticiasHJ_cmd.Prepared = true
Set NoticiasHJ = NoticiasHJ_cmd.Execute
NoticiasHJ_numRows = 0
%>
Posted 07/08/2007, 12:24
Posted 07/08/2007, 13:30
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/CadNoticias.asp" -->
<%
Dim NoticiasHJ
Dim NoticiasHJ_cmd
Dim NoticiasHJ_numRows
Set NoticiasHJ_cmd = Server.CreateObject ("ADODB.Recordset")
NoticiasHJ_cmd.ActiveConnection = MM_CadNoticias_STRING
NoticiasHJ_cmd.CommandText = "SELECT * FROM Noticias WHERE [DATA] = date()"
NoticiasHJ_cmd.Prepared = true
Set NoticiasHJ = NoticiasHJ_cmd.Execute
NoticiasHJ_numRows = 0
%>
<%
If NoticiasHJ.EOF And NoticiasHJ.BOF Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
</head>
<body>
<%=(NoticiasHJ.Fields.Item("TITULO").Value)%>
</body>
</html>
<%
NoticiasHJ.Close()
Set NoticiasHJ = Nothing
%>Edição feita por: Luka13, 07/08/2007, 13:33.
Posted 07/08/2007, 18:49
Ainda não deu.
<% If NoticiasHJ.EOF And NoticiasHJ.BOF Then Response.Write("Hoje não tem nenhuma informação") End If %> <% Dim NoticiasHJ Dim NoticiasHJ_cmd Dim NoticiasHJ_numRows Set NoticiasHJ_cmd = Server.CreateObject ("ADODB.Command") NoticiasHJ_cmd.ActiveConnection = MM_CadNoticias_STRING NoticiasHJ_cmd.CommandText = "SELECT * FROM Noticias WHERE [DATA] = date()" NoticiasHJ_cmd.Prepared = true Set NoticiasHJ = NoticiasHJ_cmd.Execute NoticiasHJ_numRows = 0 %>
Edição feita por: Humberto - S.O.S., 07/08/2007, 18:50.
Posted 08/08/2007, 08:23
Posted 08/08/2007, 10:40
<%
If NoticiasHJ.EOF And NoticiasHJ.BOF Then
Response.Write("Hoje não tem nenhuma informação")
End If
%>Aonde voce quer que fique a mensagem, mas lembrese! coloque abaixo da chamada da conexao (RECORDSET).Posted 08/08/2007, 11:27
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)