Forums
This topic is locked
returning only what i search for
Posted 03 Oct 2002 17:30:59
1
has voted
03 Oct 2002 17:30:59 Simon Bloodworth posted:
I have created a page that lists distinct titles from a column in my databse which have a go to detail page link on them and they carry their own value, on my next page it set up to display all records matching that field using a move to specific record, but when i do the search, it returns the records it finds but continues to display all the other records that are under it in the database, so in a worst case when the search requires the top record to be displayed, it displays all the records in the column.What am I doing wrong?
RedLeader
Replies
Replied 04 Oct 2002 18:55:02
04 Oct 2002 18:55:02 Dave Thomas replied:
sounds like your SQL statement for the search is wrong.
post it up and let's have a look
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
post it up and let's have a look
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Replied 07 Oct 2002 09:49:04
07 Oct 2002 09:49:04 Simon Bloodworth replied:
the code for the recordset i have on that page is as follows:
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_downloads_source_STRING
Recordset1.Source = "SELECT Id_Ref, Id_Product, Id_Category FROM testimonials"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 5
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
The query that goes to the page is something like
www.???.com/secure/testimonials_main.asp?IdCategory=?????
I thought it would work as it would only pull data that matched the query from the previous page, but obviously not.
Your help is greatly appreciated.
RedLeader
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset"

Recordset1.ActiveConnection = MM_downloads_source_STRING
Recordset1.Source = "SELECT Id_Ref, Id_Product, Id_Category FROM testimonials"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 5
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
The query that goes to the page is something like
www.???.com/secure/testimonials_main.asp?IdCategory=?????
I thought it would work as it would only pull data that matched the query from the previous page, but obviously not.
Your help is greatly appreciated.
RedLeader
Replied 07 Oct 2002 14:48:45
07 Oct 2002 14:48:45 Brent Colflesh replied:
Dear RedLeader,
Your query should read:
Recordset1.Source = "SELECT Id_Ref, Id_Product, Id_Category FROM testimonials WHERE IdCategory = $yourPassedVariable"
Regards,
Brent
Your query should read:
Recordset1.Source = "SELECT Id_Ref, Id_Product, Id_Category FROM testimonials WHERE IdCategory = $yourPassedVariable"
Regards,
Brent
Replied 08 Oct 2002 14:31:35
08 Oct 2002 14:31:35 Simon Bloodworth replied:
You are a star - Why is it always something so simple and is staring you right in the face.
All up and running now - cheers again
RedLeader
All up and running now - cheers again
RedLeader