
April 24th, 2002, 09:04 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 23
|
|
|
Retrieving one record out of 1000 from tabel
<i><b>Originally posted by : Malte (newbrainstorm@hotmail.com)</b></i><br />I have a table with 1000 seatnumbers. Everytime the website is accessed a new seat should come up (starting with 1 up to 1000) . After the seat came up, it should be deleted from the table. I have used a stored procedure and I call it in ASP.<br />How should the SELECT statement look like in the stored proc.?<br />I have now this, which will show all 1000 seats at once:<br />Stored procedure:<br /><br />SELECT [02seatno_mad1000].i1_seatno<br />FROM 02seatno_mad1000;<br /><br />The ASP:<br /><br /><% <br /> ' Connection String<br /> ' Provide relative path to your StoredProc.mdb<br /> ' database<br /> Dim reservat_date <br /> Dim i1_seatno <br /> <br /> reservat_date = Date()<br /> <br /> ' Connection String<br /> ' Provide relative path to your StoredProc.mdb<br /> ' database<br /><br /> Dim connStr<br /> connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Netwings_db1.mdb")<br /><br /> ' Connection Object<br /> Dim con<br /> Set con = Server.CreateObject("ADODB.Connection")<br /> <br /> Dim rs<br /> ' connecting to database<br /> con.Open connStr<br /><br /> ' executing stored procedure<br /> Set rs = con.Execute ("exec call_seat_mad 'i1_seatno'")<br /> ' showing all records<br /> While Not rs.EOF<br /> Response.Write rs(0) & " " <br /> rs.MoveNext<br /> Wend<br /><br /> ' closing connection and freeing resources<br /> con.Close<br /><br /> Set rs = Nothing<br /><br /> Set con = Nothing<br /> %><br /><br />
|