Hi
I created an Interdev ASP site with MS SQL server running behind it as a data source. From the SQL tables I want to display the entire contents when the index page is loaded, so I used the "Select * from Overview" command in the SQL recordset. When entering a string in a textbox, the database looks for any values that contain this string. Therefore, different buttons call the next procedure with different values for the s_ID parameter :
sub SetQuery(S_ID)
Dim S_String
S_String = S_box.value
if S_String <> "" then
SQLString = "SELECT * FROM Overview WHERE " + trim (S_ID) + " LIKE "
SQLString = SQLString + "'" + trim(S_String) + "%'"
else
SQLString = "SELECT * FROM Overview"
end if
Search.close()
Search.setSQLText(SQLString)
Search.open()
end sub
Until now, everything works fine : the grid that is linked to the recordset shows the entire DB contents when first loading the page and when no value is entered before a search, and it displays the search results when a valid search parameter is supplied.
However, when the scroll buttons at the bottom of the grid are pressed after a search (when for example the grid shows page 1 of 3 of the search results), the grid continues with page 2... of the entire table contents (so page 2 of 865 instead of the 3 pages with search results). Apparently, the recordset opens with the adapted SQL statement after a search, but when you start to scroll it seems to take the default SQL statement (Select * ...) back. Can these scroll buttons be redefined to use the search SQL command, or is there any other solution to solve this?
Thanks for helping.
Tim
I created an Interdev ASP site with MS SQL server running behind it as a data source. From the SQL tables I want to display the entire contents when the index page is loaded, so I used the "Select * from Overview" command in the SQL recordset. When entering a string in a textbox, the database looks for any values that contain this string. Therefore, different buttons call the next procedure with different values for the s_ID parameter :
sub SetQuery(S_ID)
Dim S_String
S_String = S_box.value
if S_String <> "" then
SQLString = "SELECT * FROM Overview WHERE " + trim (S_ID) + " LIKE "
SQLString = SQLString + "'" + trim(S_String) + "%'"
else
SQLString = "SELECT * FROM Overview"
end if
Search.close()
Search.setSQLText(SQLString)
Search.open()
end sub
Until now, everything works fine : the grid that is linked to the recordset shows the entire DB contents when first loading the page and when no value is entered before a search, and it displays the search results when a valid search parameter is supplied.
However, when the scroll buttons at the bottom of the grid are pressed after a search (when for example the grid shows page 1 of 3 of the search results), the grid continues with page 2... of the entire table contents (so page 2 of 865 instead of the 3 pages with search results). Apparently, the recordset opens with the adapted SQL statement after a search, but when you start to scroll it seems to take the default SQL statement (Select * ...) back. Can these scroll buttons be redefined to use the search SQL command, or is there any other solution to solve this?
Thanks for helping.
Tim