 |
| 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
|
|
|
|

September 19th, 2003, 09:58 AM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
database question.
Hi,
I made a application form and stored values of the field in the database, so i can allow them to change the field values. IE.
ID | FIELD NAME
---------------
1 | First Name:
---------------
2 | Last Name:
etc...
Is there a way that i can store the data when the user completes the form in a database. Do i have to create another database? And the column names have to be Field1, field2, field3 right, since the field names are dynamic and there is no way i can have column names the same as the field names?
|
|

September 20th, 2003, 02:36 PM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Column name can be anything as you like, as long as not the reserved words if you using the SQL statment.
for Stored value, first you should insert the record, and you should have a field as autonumbered, so you can got the the record as form the autonumber, afterward you can update, and stored value.
|
|

September 23rd, 2003, 04:09 PM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
|
|
What type of database are you using?
|
|

September 23rd, 2003, 11:34 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
accesss
|
|

September 24th, 2003, 01:50 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Here you go. Let me know how it works for you.
Page1.asp as follows...
<form method="Post" action="Page2.asp">
<input type="text" name="FirstName" value="">
<input type="text" name="LastName" value="">
<input type="Submit" Value="Submit">
</form>
Page2.asp as follows...
<%
db = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=whatever.mdb"
FirstName = request("FirstName")
LastName = request("LastName")
set rs = server.createobject("adodb.recordset")
sql = "select * from table"
rs.open sql, db, 3, 3
rs.addnew
rs("FirstName") = FirstName
rs("FirstName") = LastName
rs.update
%>
NOTE:
rs("FirstName"), rs("LastName") are the fields in the database itself.
FirstName = request("FirstName"), LastName = request("LastName") are the values that you are requesting from the page that has the form that the user submits.
|
|

September 29th, 2003, 03:11 PM
|
|
Authorized User
|
|
Join Date: Aug 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks. works great.
|
|
 |