Forums
This topic is locked
Retrieve fields after INSERT statement
Posted 02 Aug 2004 12:29:47
1
has voted
02 Aug 2004 12:29:47 Rene Bandsma posted:
I want to retrieve some variables to a follow up page after I inserted some fields into a record.So the variables should be used to fill the database and then show the variables in a next page with Request.Form or QueryString....
Any ideas?
Replies
Replied 02 Aug 2004 16:36:05
02 Aug 2004 16:36:05 Owen Eastwick replied:
There's a couple of way you could do this.
1. Insert the record, retrieve the newly created record identity value then redirect to a second page with the new record identity as a URL Parameter and use this value to rtrieve a recordset and display the newly created record. For Access: www.drdev.net/article06.htm, for SQL Server: www.drdev.net/article08.htm
2. Insert the new record and then simply pass all the values to a second page as URL parameters, something like:
<%
strName = Request.Form("txtName"
strAddress = Request.Form("txtAddress"
strTel = Request.Form("txtTel"
.....
INSERT COMMAND CODE
.....
Response.Redirect("NextPage.asp?Name=" & strName & "&Address=" & strAddress & "&Tel=" & strTel)
%>
Then display the values on the next page:
Name: <%= Request.QueryString("Name" %><br>
Address: <%= Request.QueryString("Address" %><br>
Telepone: <%= Request.QueryString("Tel" %>
Regards
Owen.
-------------------------------------------------------------------------------------------
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/
1. Insert the record, retrieve the newly created record identity value then redirect to a second page with the new record identity as a URL Parameter and use this value to rtrieve a recordset and display the newly created record. For Access: www.drdev.net/article06.htm, for SQL Server: www.drdev.net/article08.htm
2. Insert the new record and then simply pass all the values to a second page as URL parameters, something like:
<%
strName = Request.Form("txtName"
strAddress = Request.Form("txtAddress"
strTel = Request.Form("txtTel"
.....
INSERT COMMAND CODE
.....
Response.Redirect("NextPage.asp?Name=" & strName & "&Address=" & strAddress & "&Tel=" & strTel)
%>
Then display the values on the next page:
Name: <%= Request.QueryString("Name" %><br>
Address: <%= Request.QueryString("Address" %><br>
Telepone: <%= Request.QueryString("Tel" %>
Regards
Owen.
-------------------------------------------------------------------------------------------
Developer services and tutorials: www.drdev.net
Multiple Parameter UD4 / Access 2000 Search Tutorial: www.tdsf.co.uk/tdsfdemo/