|
 |
asp_databases thread: How do I pass the recordset to a button in ASP
Message #1 by "Ken Smock" <ken.smock@f...> on Fri, 4 Oct 2002 21:34:15
|
|
I am trying to populate a form with data from a database one record at a
time. I want the user to be able to view several records, but only one at
a time on a form. I have placed buttons on the form to allow them to
scroll forwards and backwards (movefirst, movenext, moveprevious, etc...),
but every time I click any of the buttons, it doesn't recognize the
recordset. What am I doing wrong ?????
Here is a sample of the code:
<TR>
<TD align=right width="246" valign="middle" height="29"> TRANS CODE:</TD>
<TD align=left height="29" width="116"><INPUT name="transcode"
VALUE="<%=objrs("transcode")%>" size="20"</TD>
</TR>
<button id="cmdFirst" title="First Record"
onclick="objrs.MoveFirst()"> |< </button>
<button id="cmdPrevious" title="Previous Record"
onclick="if (!objrs.BOF) objrs.MovePrevious()">
< </button>
<button id="cmdNext" title="Next Record"
onclick="if (!objrs.EOF) objrs.MoveNext()">
> </button>
Thanks,
Ken
Message #2 by Colin.Montgomery@C... on Mon, 7 Oct 2002 12:58:42 +0100
|
|
ASP is stateless - i.e. once your page has executed and supplied the
recordset, it closes all recordsets etc (after sending the HTML that is).
What you need is "recordset paging" - you'll find many links and articles on
sites like www.4guysfromrolla.com etc on this topic.
HTH,
Col
-----Original Message-----
From: Ken Smock [mailto:ken.smock@f...]
Sent: 04 October 2002 22:34
To: ASP Databases
Subject: [asp_databases] How do I pass the recordset to a button in ASP
I am trying to populate a form with data from a database one record at a
time. I want the user to be able to view several records, but only one at
a time on a form. I have placed buttons on the form to allow them to
scroll forwards and backwards (movefirst, movenext, moveprevious, etc...),
but every time I click any of the buttons, it doesn't recognize the
recordset. What am I doing wrong ?????
Here is a sample of the code:
<TR>
<TD align=right width="246" valign="middle" height="29"> TRANS CODE:</TD>
<TD align=left height="29" width="116"><INPUT name="transcode"
VALUE="<%=objrs("transcode")%>" size="20"</TD>
</TR>
<button id="cmdFirst" title="First Record"
onclick="objrs.MoveFirst()"> |< </button>
<button id="cmdPrevious" title="Previous Record"
onclick="if (!objrs.BOF) objrs.MovePrevious()">
< </button>
<button id="cmdNext" title="Next Record"
onclick="if (!objrs.EOF) objrs.MoveNext()">
> </button>
Thanks,
Ken
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.
|
|
 |