CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Redirect In No Records Found

Print topic Send  topic

Author Message
Joe M
Posted: 06/17/2004, 8:59 AM

I just need a way to redirect a user if no record are found,

They would be Searching record from a search page and if no records were found they would be redirected to another page, i am using

. ASP
MS Access
CCS
DonB
Posted: 06/18/2004, 6:58 AM

Take a look at any of your ASP pages. There is a section marked with the
comment "Go to destination page". This shows how to invoke another page.

You can take this concept and replicate it where it makes the most sense for
your application - perhaps if you have a grid with the "number of records"
feature you could put it in the Before Show of the Label that displays the
number of records. I.e., if the Label is assigned the value of zero, then
do the redirect at that point.

--
DonB

http://www.gotodon.com/ccbth


<JoeM@forum.codecharge (Joe M)> wrote in message
news:640d1bff2c7b4d@news.codecharge.com...
> I just need a way to redirect a user if no record are found,
>
> They would be Searching record from a search page and if no records were
found
> they would be redirected to another page, i am using
>
> ASP
> MS Access
> CCS
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Joe M
Posted: 06/18/2004, 10:29 AM

Hey DonB
Thanks,

This is what i have, It is a password Retrieval Search form with a grid below it, Both Search and Grid on Same Page, I have a search form that asked for username and email, then below the search is the grid that will retrieve that record, But when on the page i use this follow code to make the grid not visable until data is enter, by doing that, i loose the "No Record Founds" also. so when someone that does not have a username searches for a username it does not show anything, No error message no nothing, people might htink that nothing is happend, so i thought if i could have a redirect if no record was found after the search was done, or a label error, or something, it would help, Thanks

Here is the code i am using to Hide the Grid if no Results, This is in the before show event,

If Responses.Recordset.EOF Then  
     Responses.Visible = False   
  End If  

.ASP
CCS
Ms Access
DonB
Posted: 06/22/2004, 2:42 PM

It does not show the "no records" because you are telling not to - when
there are no records (EOF is true) then you hide the grid.

What you really want to do is hide the grid if there is no search criteria.
In the event handler, check CCGetParam("yourparam", Empty) and hide the grid
when the result of that function is "Empty". Obviously, is you have more
than one search field, then you will have to check them all. This works
because the search criteria get tacked onto the URL as parameters.

If there are a whole lot of parameters, then you could create a hidden field
in the search form with a default value of "1" (any value will work), and
test for that single parameter to see if it's not Empty. That way, you know
at least one parameter was passed and don't have to worry about which ones.

This will eliminate the need for doing a redirect

--
DonB

http://www.gotodon.com/ccbth


<JoeM@forum.codecharge (Joe M)> wrote in message
news:640d3267629d33@news.codecharge.com...
> Hey DonB
> Thanks,
>
> This is what i have, It is a password Retrieval Search form with a grid
below
> it, Both Search and Grid on Same Page, I have a search form that asked for
> username and email, then below the search is the grid that will retrieve
that
> record, But when on the page i use this follow code to make the grid not
> visable until data is enter, by doing that, i loose the "No Record Founds"
> also. so when someone that does not have a username searches for a
username it
> does not show anything, No error message no nothing, people might htink
that
> nothing is happend, so i thought if i could have a redirect if no record
was
> found after the search was done, or a label error, or something, it would
help,
> Thanks
>
> Here is the code i am using to Hide the Grid if no Results, This is in the
> before show event,
>
>
If Responses.Recordset.EOF Then  
>      Responses.Visible = False  
>   End If  
> 
>
> ASP
> CCS
> Ms Access
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Tuong Do
Posted: 06/23/2004, 10:52 PM

I would insert a label1 to the page (not to the grid)

If Responses.Recordset.EOF Then  
      Responses.Visible = False  
      If (Request.QueryString("email") <> empty) Then  
             ' They click the search button with an email value and there is  
record found  
              Label1.value = "No record found OR what what ever the  
message."  
      End If  
  
   End If  
 




Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.