?
Solved

FrontPage Form writting to database

Posted on 2003-02-26
8
Medium Priority
?
216 Views
Last Modified: 2013-12-24
I have a Form written with FrontPage 2002 that displays the data to another form.  How do I make the second form submit the data to a database?
I use the <%response.write(request.form("address"))%>
to get the data to be viewable on the second form. Am I not bringing over the data to the seond form that why I can get it to post to databse?
0
Comment
Question by:jamesjs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 1

Expert Comment

by:drnadeem
ID: 8031569
listening
0
 
LVL 10

Expert Comment

by:KenAdney
ID: 8035123
I usually code this directly as an Active Server Page (ASP).  The page has to have an .asp file extension and you can look at your code to be sure that it's making a connection to the database and doing the update.

Here's a one version of code that makes a connection to an Access database (this would all be inside a <% %> except for my comments which begin with a -).

Set DataConn = Server.CreateObject("ADODB.Connection")
- this says you're going to make a connection

Set rs = Server.CreateObject("ADODB.Recordset")
-this says you're creating a recordset

DataConn.Open "DBQ=" & Server.Mappath("database.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
-this tells the server what kind of database

sql = "SELECT * FROM sometable"
-this is a basic SQL statement for getting the particular table you want to update

rs.Open sql, DataConn, 1, 3
-this opens the connection & matches the SQL statement with the connection and the recordset

rs1.AddNew
-what you want to do with the data - i.e. add it

if request.form("data") <> "" then rs.Fields("data")    = request.form("data")

-if the form field "data" isn't blank then update the table field "data" with it's contents

rs.Update
-make the update

You should also have some code about closing the connection to the database.  Hope this helps.
0
 
LVL 14

Accepted Solution

by:
hhammash earned 800 total points
ID: 8053032
Hi,

The second form should be an .ASP page. You can use in the form fields:
<%=request.form("FieldName")%>

Right click the second form in Normal View
Select Form Properties
Click Send to Database
Click Options
Select Database Connection to Use
Select Table to Hold Form Results

Save it as ASP page.

It will write to the database

Regards
hhammash
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

Author Comment

by:jamesjs
ID: 8058361
When I go to the form properties and then options I don't see any of the form fields to be saved that I want to collect from the form.  And the add button is greyed out.
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8064039
Hi,

No need. OK,  I will put the full steps as an example of mine.

Scenario:
---------
I have a database with one table that has the following fields: Name,Department,Supervisor.

I have a form called Submit.asp and another form called Verify.asp.  The user will fill in the Sumbit.asp and presses Submit.  Then it goes to the Verify.asp form where all the information entered in the first form are automatically displayed on the second for verification before submitting to the database.

Create the forms:
-----------------
Submit.asp
----------
Open a new page
Inser Form
Line 1: Type Name:
Insert/Form/Textbox after the Name:
Double click the Textbox and name it as Name
Line 2: Type Department:
Insert/Form/Textboxk after the Department:
Doubl click the textbox and name it as Department
Line 3: Type Supervisor:
Insert/Form/Textbox after the Supervisor:
Double click the textbox and name it as Supervisor
Right click the form,  select properties
Select Send to Other
Click Options
In Action Put: Verify.asp
Save the form as Submit.asp

Verify.asp
----------
Open a new page
Insert form
Line 1: Same as above exactly in line 1 of Submit.asp then when you double click the Textbox name it as Name and in the value under it put: <%=request.form("Name")%>

Line 2: Same as above in line 2 of Submit.asp then when you double click the text box name it as Department,  then under it in the value put: <%=request.form("Department")%>

Line 3: Same as above in line 3 of Submit.asp then when you double click the text box name it as Supervisor, then under it in the value put: <%=request.form("Supervisor")%>

Right Click the form
Select Properties
Send to Database
Click Options
Select the Database Connection
Select the Data source (which table)
Then go to saved fields and verify each one.
Save the page as Verify.asp

Now when you open Submit.asp and fill the form,  then click submit,  the data will be send to Verify.asp,  if the user has any changes he/she can make them here then press submit to send the data to the database.

Regards
hhammash
0
 

Author Comment

by:jamesjs
ID: 8075872
You helped me again.

Thank you so much..
0
 

Expert Comment

by:bnp6622
ID: 12489190
your solution also helped me.   Question when the submit form has drop down menu selection of items, how do you populate the second form with that info..   Or can you only do this with "text box" fields

thank you
bruce
0
 
LVL 14

Expert Comment

by:hhammash
ID: 12491447
Hi bruce,

Just mention the name of the drop down menu like you do with the text field.

<%=request.form("DropDownMenuName")%>

hhammash
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question