Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting my search result= gives back all my records

Status
Not open for further replies.

Beat

Technical User
Joined
Aug 26, 2001
Messages
41
Location
SE
I have a search function which lists the records that match the the search.

Then I have a listbox that gives the user an option to sort the results.

But, when I sort the results it refreshes the page with all the records sorted. It seems to forget my search variable.

Where is the problem?

Thanks!
 
Maybe try passing your SQL to a variable & then adding to the string with the ORDER BY added to the end as your new statement I dont want to go to Chelsea!!!
 
Hello!

I kind of have the same problem, I have a search page that has three different parameters...recordID, LastName, FirstName. The problem is that no matter what combination I try the results page shows ALL records, not just the one(s) that match the search parameters. Heres' my SQL statement on the results page recordset:


SELECT *
FROM Main_Table
WHERE Record_ID LIKE 'varRecordID' OR LastName LIKE 'varLastName' OR FirstName LIKE 'varFirstName'


Each variable has been set up like this:

Name Default Value Run-Time Value

varLastName % Request.QueryString("LN")
varFirstName % Request.QueryString("FN")
varRecordID % Request.QueryString("ID")

Does anyone know how to get the results page to work properly? I need it to find specific records whether it's one variable or two or three.

Thanks,
Jisoo22
 
Maybe use AND instead of OR? I dont want to go to Chelsea!!!
 
Tried AND, got the same kind of messed up result. Any ideas? I'm open to anything!

Jisoo22
 
Response.Write the SQL to the screen, it looks like your variables are not picking up a value and therefore are using "%" so are pulling everything out of the database. Live long and make your kids suffer..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top