Link to home
Start Free TrialLog in
Avatar of JesseSM
JesseSM

asked on

ASP Syntax

I'm doing a page where I'm showing 25 records at a time returned from a DB, when the next button is pressed I reload the page with a counter to count the next 25 records to be shown. The following is how I create my SQL Select statement based on a form Combo box selection. When the page is reloaded the strChoice variable is "" (null). so their is no SELECT statement created. How can I make sure that the strChoice variable is the same when I reload the page when the 'next' button is pressed?
I thought a request.querystring("strChoice") or something might work, no results yet.


'Request Combo Box Choice from Browse Form
strChoice = request.form("BrowseID")    
Set objConn = Server.createObject("ADODB.Connection")
objConn.open strConnect

if strChoice = 0 then      'Chose by Artist
       strSQL = "Select * from tblArtist, tblWork Where tblArtist.ArtistID = tblWork.ArtistID Order By tblArtist.LastName"
else                       'Chose by Title
       strSQL = "Select * from tblArtist, tblWork Where tblArtist.ArtistID = tblWork.ArtistID Order By tblWork.Title"
end if
Set objRS = Server.CreateObject("ADODB.recordset")
   objRS.open strSQL, strConnect
ASKER CERTIFIED SOLUTION
Avatar of grimkin
grimkin
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial