This topic is locked

Display messaging when table is blank

5/12/2009 9:28:48 PM
ASPRunnerPro General questions
W
wisdom2009 author

Hi Every one,
I am trying to populate an error message if no record in the table, i was using this solution but it does not work.
Can someone please guide me
<%

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

rstmp.Open "Select Case When count(*) = 0 THEN 'Database under Maintenance' Else [dtlastrun] END FROM rpt.tbldatasource Group by [dtlastrun]",dbconnection

if not rstmp.eof then

Response.Write rstmp(0)

end if

rstmp.close : set rstmp=nothing %>

J
Jane 5/13/2009

Hi,
what ASPRunnerPro version do you use?

W
wisdom2009 author 5/13/2009

Hi,

what ASPRunnerPro version do you use?



I am using ASP Runner 6.1

Sergey Kornilov admin 5/13/2009

Syntax looks correct.
What event do you use for this purpose?

What exactly doesn't work? Any error messages?

Does SQL query works when you run it manually?

W
wisdom2009 author 5/15/2009

Syntax looks correct.

What event do you use for this purpose?

What exactly doesn't work? Any error messages?

Does SQL query works when you run it manually?


Thanks for your reply, I dont' receive any errors but when table is blank the result is blank too, what i mean about that is the message i want to be diplayed when there is no data in the table does not display just an empty space instead of 'Database under Maintenance'.