Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2003, 05:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear NotNowJohn

Thanks for yore response.
Ok if my objective solves only one page, I will use coding in one page.

It is display the records if user selects three options.

If user selects one option or select two options from the select list it not displays the records from the table ?

I am using this query

ssql="SELECT * FROM ARC where contractno='" &contractno & "' AND category='" &category & "' AND recordno='" &recordno& "' "



Secondly if record not found in the table it should display the message that “ Record not found “ and redirect to firstpage.asp

I am developing intranet sit for the company.

Thanks for your cooperation.

Best regards.

Mateen Martin
[email protected]


Quote:
quote:Originally posted by NotNowJohn
 Mateen,

You don't need 6 pages - you need only one page to process the select oprions from your select page. You pull out data from arc table on each page you want to create (for each users' selection or combination) - so you have to create appropriate select statement only.
So, you have to add this on your result page you sent in teh previous posts:
Code:
contractno=Request.Form("contractno")
recordno=Request.Form("recordno")
category=Request.Form("category")

ssql="SELECT * FROM archive2 where "
If contractno=="" then
    ssql=ssql & "1=1"
Else
    ssql=ssql & " contractno='" & contractno & "'"
End If

If recordno<>"" then
    ssql=ssql & " AND recordno='" & recordno & "'"
End If

If category<>"" then
    ssql=ssql & " AND category='" & category & "'"
End If
These statements include all user choosing combinations.
Why you insist on 6 pages?

...but the Soon is eclipsed by the Moon
 
Old June 17th, 2003, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Mateen,

I wrote in the previous reply that you have to change ssql statement:

Code:
contractno=Request.Form("contractno")
recordno=Request.Form("recordno")
category=Request.Form("category")
ssql="SELECT * FROM ARC where "
If contractno="" then
    ssql=ssql & "1=1"
Else
    ssql=ssql & " contractno='" & contractno & "'"
End If

If recordno<>"" then
    ssql=ssql & " AND recordno='" & recordno & "'"
End If

If category<>"" then
    ssql=ssql & " AND category='" & category & "'"
End If
...but the Soon is eclipsed by the Moon
 
Old June 17th, 2003, 06:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I not chang the sql statement
I use same statement as following you write.

regards.

Mateen

Quote:
quote:Originally posted by NotNowJohn
 Mateen,

I wrote in the previous reply that you have to change ssql statement:

Code:
contractno=Request.Form("contractno")
recordno=Request.Form("recordno")
category=Request.Form("category")
ssql="SELECT * FROM ARC where "
If contractno="" then
    ssql=ssql & "1=1"
Else
    ssql=ssql & " contractno='" & contractno & "'"
End If

If recordno<>"" then
    ssql=ssql & " AND recordno='" & recordno & "'"
End If

If category<>"" then
    ssql=ssql & " AND category='" & category & "'"
End If
...but the Soon is eclipsed by the Moon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Select/Option Problem TSEROOGY Javascript 2 October 4th, 2004 03:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.