Problem with Insert command SQL query in FP2003

  • Thread starter Federico Moschini [328594]
  • Start date
F

Federico Moschini [328594]

I am trying to send a form to both a database and an email as follows but
this statement seems not to be accepted with FP2003 with SP2 INSERT
INTO table (firstname) Values ('::fname::')

Do you have any suggestion or this is a bug of FP2003? With FP2000 no
problem.

------------------------------------------------------------------------------------
Develop a page called, for this example, Form.htm.

On this page you will place a form with the information that is to be
submitted to a database.

For this example, use only one text box. (First Name)

Develop a second page called Form.asp.

This page updates the database

Develop a third page called Email.htm.

This page will be included in Form.asp, which will contain the form
information to submit the email.

The optional page is a confirmation page.

1. Launch FrontPage and open a web
2. Create a new page and save it as Form.htm
3. Create another new page and call it Form.asp
4. Create another page and call it Email.htm
5. Return to Form.htm and click on Insert | Form | One Line Text Box
6. Double-click the text box and name the field "fname" without the
quotes and click OK
7. Right-click on the form and select Form Properties
8. Click Send to Other and be sure it says Custom ISAPI, NSAPI, CGI,
ASP.. then click Options
9. In the Action type "Form.asp" without the quotes and be sure it says
"Post"
10. Click OK twice to get back to the page
11. Type "First Name:" next to the text box and save the page
12. Go to Email.htm
13. Click on Insert | Form and then type something like "Thanks for
submitting the info, click Submit to continue." (it is very important that
they click submit)
14. Right-click the form and go to Form Properties
15. Click Send To: and type in the email address
16. Click Advanced
17. Click Add to add a hidden field
18. Name this field "fname" without the quotes
19. Type the following code into the value box <%=request.form("fname")%>
20. Click OK twice to get back to the page
21. Save the page
22. Now go to Form.asp and hit enter twice then click on Insert | Component
| Include Page and type Email.htm into the box; click OK
23. Click at the top of the page and click on Insert | Database | Results
24. On Step One choose your database connection
25. On Step Two click Custom Query and type this SQL statement: INSERT
INTO table (firstname) Values ('::fname::') NOTE: The statement should be
changed so that "table" states the actual table name, and "firstname" is a
column value in the database. Notice that fname is the form field name from
Form.htm. It is good practice to have your form field names match your
database table names.
26. In Step 3, under More Options, make sure you assign default values for
each field name and make sure that you erase the message No Records
Returned.
27. Click through the rest of the defaults, click Finish and save the page.
28. OPTIONAL: Make a page called Confirm.htm
29. In Confirm.htm you can type in a confirmation message with links that
will take you back to Form.htm or any other page on your site.
30. Open Email.htm
31. Right click the form and go to properties
32. Click Options | Confirmation Page | URL of Confirmation Page type
Confirm.htm
33. OK twice
34. Save the page (Email.htm)
 
S

Stefan B Rusynko

Are you changing "table" to your actual table name, and "firstname" to your column (field) name in your database as per step 25

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am trying to send a form to both a database and an email as follows but
| this statement seems not to be accepted with FP2003 with SP2 INSERT
| INTO table (firstname) Values ('::fname::')
|
| Do you have any suggestion or this is a bug of FP2003? With FP2000 no
| problem.
|
| ------------------------------------------------------------------------------------
| Develop a page called, for this example, Form.htm.
|
| On this page you will place a form with the information that is to be
| submitted to a database.
|
| For this example, use only one text box. (First Name)
|
| Develop a second page called Form.asp.
|
| This page updates the database
|
| Develop a third page called Email.htm.
|
| This page will be included in Form.asp, which will contain the form
| information to submit the email.
|
| The optional page is a confirmation page.
|
| 1. Launch FrontPage and open a web
| 2. Create a new page and save it as Form.htm
| 3. Create another new page and call it Form.asp
| 4. Create another page and call it Email.htm
| 5. Return to Form.htm and click on Insert | Form | One Line Text Box
| 6. Double-click the text box and name the field "fname" without the
| quotes and click OK
| 7. Right-click on the form and select Form Properties
| 8. Click Send to Other and be sure it says Custom ISAPI, NSAPI, CGI,
| ASP.. then click Options
| 9. In the Action type "Form.asp" without the quotes and be sure it says
| "Post"
| 10. Click OK twice to get back to the page
| 11. Type "First Name:" next to the text box and save the page
| 12. Go to Email.htm
| 13. Click on Insert | Form and then type something like "Thanks for
| submitting the info, click Submit to continue." (it is very important that
| they click submit)
| 14. Right-click the form and go to Form Properties
| 15. Click Send To: and type in the email address
| 16. Click Advanced
| 17. Click Add to add a hidden field
| 18. Name this field "fname" without the quotes
| 19. Type the following code into the value box <%=request.form("fname")%>
| 20. Click OK twice to get back to the page
| 21. Save the page
| 22. Now go to Form.asp and hit enter twice then click on Insert | Component
|| Include Page and type Email.htm into the box; click OK
| 23. Click at the top of the page and click on Insert | Database | Results
| 24. On Step One choose your database connection
| 25. On Step Two click Custom Query and type this SQL statement: INSERT
| INTO table (firstname) Values ('::fname::') NOTE: The statement should be
| changed so that "table" states the actual table name, and "firstname" is a
| column value in the database. Notice that fname is the form field name from
| Form.htm. It is good practice to have your form field names match your
| database table names.
| 26. In Step 3, under More Options, make sure you assign default values for
| each field name and make sure that you erase the message No Records
| Returned.
| 27. Click through the rest of the defaults, click Finish and save the page.
| 28. OPTIONAL: Make a page called Confirm.htm
| 29. In Confirm.htm you can type in a confirmation message with links that
| will take you back to Form.htm or any other page on your site.
| 30. Open Email.htm
| 31. Right click the form and go to properties
| 32. Click Options | Confirmation Page | URL of Confirmation Page type
| Confirm.htm
| 33. OK twice
| 34. Save the page (Email.htm)
|
|
 
F

Federico Moschini [328594]

Yes, did you try to create the pages. You will notice that FP2003 block you
to create the page with this insert command...

Federico

Stefan B Rusynko said:
Are you changing "table" to your actual table name, and "firstname" to
your column (field) name in your database as per step 25

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I am trying to send a form to both a database and an email as follows but
| this statement seems not to be accepted with FP2003 with SP2 INSERT
| INTO table (firstname) Values ('::fname::')
|
| Do you have any suggestion or this is a bug of FP2003? With FP2000 no
| problem.
|
| ------------------------------------------------------------------------------------
| Develop a page called, for this example, Form.htm.
|
| On this page you will place a form with the information that is to be
| submitted to a database.
|
| For this example, use only one text box. (First Name)
|
| Develop a second page called Form.asp.
|
| This page updates the database
|
| Develop a third page called Email.htm.
|
| This page will be included in Form.asp, which will contain the form
| information to submit the email.
|
| The optional page is a confirmation page.
|
| 1. Launch FrontPage and open a web
| 2. Create a new page and save it as Form.htm
| 3. Create another new page and call it Form.asp
| 4. Create another page and call it Email.htm
| 5. Return to Form.htm and click on Insert | Form | One Line Text
Box
| 6. Double-click the text box and name the field "fname" without the
| quotes and click OK
| 7. Right-click on the form and select Form Properties
| 8. Click Send to Other and be sure it says Custom ISAPI, NSAPI,
CGI,
| ASP.. then click Options
| 9. In the Action type "Form.asp" without the quotes and be sure it
says
| "Post"
| 10. Click OK twice to get back to the page
| 11. Type "First Name:" next to the text box and save the page
| 12. Go to Email.htm
| 13. Click on Insert | Form and then type something like "Thanks for
| submitting the info, click Submit to continue." (it is very important
that
| they click submit)
| 14. Right-click the form and go to Form Properties
| 15. Click Send To: and type in the email address
| 16. Click Advanced
| 17. Click Add to add a hidden field
| 18. Name this field "fname" without the quotes
| 19. Type the following code into the value box
<%=request.form("fname")%>
| 20. Click OK twice to get back to the page
| 21. Save the page
| 22. Now go to Form.asp and hit enter twice then click on Insert |
Component
|| Include Page and type Email.htm into the box; click OK
| 23. Click at the top of the page and click on Insert | Database |
Results
| 24. On Step One choose your database connection
| 25. On Step Two click Custom Query and type this SQL statement: INSERT
| INTO table (firstname) Values ('::fname::') NOTE: The statement should
be
| changed so that "table" states the actual table name, and "firstname" is
a
| column value in the database. Notice that fname is the form field name
from
| Form.htm. It is good practice to have your form field names match your
| database table names.
| 26. In Step 3, under More Options, make sure you assign default values
for
| each field name and make sure that you erase the message No Records
| Returned.
| 27. Click through the rest of the defaults, click Finish and save the
page.
| 28. OPTIONAL: Make a page called Confirm.htm
| 29. In Confirm.htm you can type in a confirmation message with links
that
| will take you back to Form.htm or any other page on your site.
| 30. Open Email.htm
| 31. Right click the form and go to properties
| 32. Click Options | Confirmation Page | URL of Confirmation Page type
| Confirm.htm
| 33. OK twice
| 34. Save the page (Email.htm)
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top