Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2007, 04:03 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default post data updates in database and posts back

Hello, I am sorry if this is hard to understand i am very new to ASP (only progrming in it for a week now)
I have a page that the user can enter data into (send.asp), then that data is sent to another page (recieve.asp)The user enters more data then hits submit. What i need is the data that was posted from send.asp to stay on recieve.asp even after the update button is pressed and the data is updated into the database (the data from send.asp will be input into the database many times) If i could do this by way of a check box (like "if chkboxyes = "on" then (data is submited to DB and it redirects to first page send.asp) else if chxboxno = "on" (then data is submited to DB and the data goes back into recieve.asp))

Below is most of the code (the drop downs from send.asp are over 300 values)

(Send.asp)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /><title>Untitled 1</title>
</head>
<body>
<form method="post" action="recieve.asp">
Start Date <input name="thestart" type="text" /><br />
End Date&nbsp; <input name="theend" type="text" /><br />
Policy #&nbsp;&nbsp;&nbsp; <input name="plcynum" type="text" /><br />
Client&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select name="theclient" style="width: 150px">
<option></option>
<option>1300 Lafayette East Cooperative</option>
<option>900 Monroe, LLC</option>
<option>900/940 Monroe and One Mason</option>
</select><br />
Carrier&nbsp;&nbsp;&nbsp;&nbsp; <select name="thecarrier" style="width: 147px">
<option></option>
<option> ABC MI Self Insured WC Fund </option>
<option> Accident Fund of America </option>
<option> ACE USA </option>
</select><br />
<input type="submit" value="Send Info"/>
</form>
</body>
</html>


(recieve.asp)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title>Untitled 1</title>
</head>

<%
Dim strstart : strstart = Request.form("thestart")
Dim strend : strend = Request.form("theend")
Dim strplcy : strplcy = Request.form("plcynum")
Dim strclient : strclient = Request.form("theclient")
Dim strcarrier : strcarrier = Request.form("thecarrier")
Session("thestart") = strstart
Session("theend") = strend
Session("plcynumd") = strplcy
Session("theclient") = strclient
Session("thecarrier") = strcarrier
Response.write "<br>Policy Information Do Not Change:<br>"

%>
<body>
<form name="myform" method="post" action="--WEBBOT-SELF--" style="height: 113px">

<input name="theend1" type="text" value="<%=Session("thestart")%>"/>
<input name="thestart1" type="text" value="<%=Session("theend")%>"/>
<input name="thepcly1" type="text" value="<%=Session("plcynumd")%>"/>
<input name="theclient1" type="text" value="<%=Session("theclient")%>"/>
<input name="thecarrier1" type="text" value="<%=Session("thecarrier")%>"/>
<br />
<fieldset name="Group1" style="height: 49px; width: 179px">
<legend>New Policy Information?</legend>
<input name="Checkboxyes" type="checkbox" style="width: 35px; height: 29px" />&nbsp;&nbsp;&nbsp;
Yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="Checkboxno" type="checkbox" style="width: 34px; height: 28px" />No</fieldset><br />
<input name="Submit1" type="submit" value="submit" /></form>
</body>
</html>
 
Old February 20th, 2007, 04:07 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What is the problem you are having?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 04:10 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am very sorry, the data from send.asp is not staying in receive.asp after i hit the submit button. It initially goes to receive.asp fine but after submitting it disappears.

 
Old February 20th, 2007, 04:23 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

what page are you submitting to?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 04:27 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Send.asp is submitting to receive.asp and recieve.asp is submitting the data into a locally stored MS Access Database. I am using Microsoft Expression Web to create everything in, and they use that WebBot thing to post to the database.

Thanks again for your help :)

 
Old February 20th, 2007, 04:29 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Then that is the reason you are not seeing the data after the post. You arent posting back to the same page, you are posting to that WebBot thing which, I would guess, it is some sort of page that is why your data isnt presisted.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 04:38 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It does take me to a weird page that just re shows what the values input were, is there any way i can connect to the database and still post the values back to the same page?

 
Old February 20th, 2007, 04:43 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Change the form action to recieve.asp. Process the data into your database, then redisplay the form. I dont know what this is:


but simply having that code in your HTML is a BAD idea. (Most importantly, i know the exact path to your .mdb and could eailsy download it by typing the path into the address bar)

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 04:56 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow, thank you very much, i never would have noticed that. If i read it write the web-bot thing is something Expression Web uses for connecting to databases. If i add the receive.asp in the action will it still be able to send the data to the database or do i need another button? I am removing that web-bot thing and trying that now.

Thanks again-

 
Old February 20th, 2007, 04:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If you post back to recieve.asp you are going to have to write your own methods of connecting to the database, inserting the data, etc. Examples on how to do that can be found easily by searching on google.

your form would be something like: <form action="recieve.asp" method="post">

you will need an <input type=submit> to post the form and have the action fire.
hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
post back SKhna ASP.NET 2.0 Basics 1 March 10th, 2008 09:23 AM
post back k.manisha ASP.NET 1.0 and 1.1 Professional 2 February 7th, 2007 02:28 PM
Post Back rngrmn Pro VB.NET 2002/2003 1 May 5th, 2006 11:21 AM
how to post xml data to server and reading back js_pandey PHP How-To 0 March 29th, 2006 01:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.