Ask a Question related to ASP Database, Design and Development.
-
Jammer #1
Newbie question: I need an ASP script to store data from a form.
I want to have a HTML form that the user fills in and
clicks submit.
I then want the data to be stored in an Access datatbase.
I've loooked and looooked... but I can't find a simple
script to do the above.
I'm really new to ASP... so I don't have much clue what i
should be doing.
Any help would be appreciated.
Thanks.
Jam
Jammer Guest
-
how to store Form data?
hello, I'm revising CMS application that was created 4 years ago and debating with myself on what is the best way to handle form entered... -
newbie question - store the variable
Dear all, Let's say I have two movies, "A" and "B". Movie "A" is a selection menu. After making the selections, user has to press an "ENTER" button... -
sorter script [was: Frustrated newbie question]
Hi drieux: The link that failed for you, worked for me. That link led to this link which had the code. ... -
newbie question: how to run a shell script from launcher
Greetings all: I've install LimeWire util on my machine, I have the following questions: - Is this a good util for file sharing in terms of... -
newbie form post question
Please tell me how I can get the values and items for a form posted using the post method. The posting page is HTML and I won't know what's in it... -
Ray at #2
Re: Newbie question: I need an ASP script to store data from a form.
Have you looked in a book such as Beginning Active Server Pages 3.0 from
Wrox, assuming it's still available? (I don't mean this to be a snide
remark, really.)
Ray at work
"Jammer" <jammer20002@yahoo.co.uk> wrote in message
news:033301c3788b$b2ea4270$a101280a@phx.gbl...> I want to have a HTML form that the user fills in and
> clicks submit.
> I then want the data to be stored in an Access datatbase.
>
> I've loooked and looooked... but I can't find a simple
> script to do the above.
>
> I'm really new to ASP... so I don't have much clue what i
> should be doing.
>
> Any help would be appreciated.
>
> Thanks.
>
>
> Jam
Ray at Guest
-
Jeff Cochran #3
Re: Newbie question: I need an ASP script to store data from a form.
On Thu, 11 Sep 2003 10:39:49 -0700, "Jammer" <jammer20002@yahoo.co.uk>
wrote:
May be looking for more than you need then. A Google of "ASP Database>I want to have a HTML form that the user fills in and
>clicks submit.
>I then want the data to be stored in an Access datatbase.
>
>I've loooked and looooked... but I can't find a simple
>script to do the above.
Tutorial" will get you literally hundreds of tutorials on accessing a
database. Try:
[url]http://asp-help.com/database/db_tutorial1.asp[/url]
For the form data, that's a second part:
[url]http://www.totalasp.co.uk/articles.asp?dismode=article&artid=121[/url]
Now all you do is combine the two to get the data from the form, and
save it to a database.
If you can learn from code, try:
1) Create an Access database with two fields in a table as follows:
Table: MemberNames
Field: FirstName
Field: LastName
The Access defaults will work fine here, save the database as
"Members.mdb" in your web folder.
2) Create the Form to enter member names as follows, and save in the
same folder as Form.htm:
---------------------------------
<html>
<head><title>Member Names Form</title></head>
<body>
<H2>Add Member Name</H2>
<form action="add_new_record.asp" method="post">
<P>First Name: <input type="text" name="FirstName"></P>
<P>Last Name: <input type="text" name="LastName"></P>
<P><input type="submit" value="Submit"><input type="button"
value="Clear"></P>
</form>
</body>
---------------------------------
</html>
Jeff Cochran Guest
-
Jeff Cochran #4
Re: Newbie question: I need an ASP script to store data from a form.
Dang! Hit "Send" too quick! :)
Balance of lesson posted below...
On Thu, 11 Sep 2003 18:23:37 GMT, [email]jcochran.nospam@naplesgov.com[/email] (Jeff
Cochran) wrote:
>>>I want to have a HTML form that the user fills in and
>>clicks submit.
>>I then want the data to be stored in an Access datatbase.
>>
>>I've loooked and looooked... but I can't find a simple
>>script to do the above.
>May be looking for more than you need then. A Google of "ASP Database
>Tutorial" will get you literally hundreds of tutorials on accessing a
>database. Try:
>
>[url]http://asp-help.com/database/db_tutorial1.asp[/url]
>
>For the form data, that's a second part:
>
>[url]http://www.totalasp.co.uk/articles.asp?dismode=article&artid=121[/url]
>
>Now all you do is combine the two to get the data from the form, and
>save it to a database.
>
>If you can learn from code, try:
>
>1) Create an Access database with two fields in a table as follows:
>
>Table: MemberNames
>Field: FirstName
>Field: LastName
>
>The Access defaults will work fine here, save the database as
>"Members.mdb" in your web folder.
>
>2) Create the Form to enter member names as follows, and save in the
>same folder as Form.htm:
>
>---------------------------------
><html>
><head><title>Member Names Form</title></head>
><body>
><H2>Add Member Name</H2>
><form action="add_new_record.asp" method="post">
><P>First Name: <input type="text" name="FirstName"></P>
><P>Last Name: <input type="text" name="LastName"></P>
><P><input type="submit" value="Submit"><input type="button"
>value="Clear"></P>
></form>
></body>
>---------------------------------
></html>
3) Create the ASP page to process the form input, as below. Save as
add_new_record.asp in the same folder:
----------------------------------
<% @LANGUAGE="VBSCRIPT" %>
<html>
<head><title>Add New Record</title></head>
<body>
<%
' Get form data and assign it to variables
FirstName = request.form("FirstName")
LastName = request.form("LastName")
' Create a query to add a record to the database
' This is broken into lines for readability only, could be one line
SQLstmt = "INSERT INTO MemberNames (FirstName, LastName)"
SQLstmt = SQLstmt & " VALUES ("
SQLstmt = SQLstmt & "'" & FirstName & "',"
SQLstmt = SQLstmt & "'" & LastName & "'"
SQLstmt = SQLstmt & ")"
' Database connection string (can be put in an include for easier
maintenance)
dbConnect = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("members.mdb") & ";"
' Create the connection and open it
set conn = server.CreateObject("ADODB.Connection")
conn.Open dbConnect
' Execute the SQL Statement
Set rs = conn.execute(SQLstmt)
' Close the connection
Conn.Close
set Conn=nothing
%>
<P>The record has been added</P>
</BODY></HTML>
--------------------------------
Watch for line wraps on these. There's no error checking, no display
page, no fancy HTML, you're on your own to figure those out. Aslk
more questions when you hit snags.
Oh, and I cut and pasted some of this code from a generic database
page I use, changed the variable names and scribbled some other code
in, so this is untested but pretty close. I'm sure others may pick
out errors or point out better methods.
Oh, and when you hit your first snag, read this:
Why do I get database-related 80004005 errors?
[url]http://www.aspfaq.com/show.asp?id=2009[/url]
Jeff
Jeff Cochran Guest
-
GVaught #5
Re: Newbie question: I need an ASP script to store data from a form.
I use a book called Beginning ASP Databases from Wrox Press. It is my Bible.
"Jammer" <jammer20002@yahoo.co.uk> wrote in message
news:033301c3788b$b2ea4270$a101280a@phx.gbl...> I want to have a HTML form that the user fills in and
> clicks submit.
> I then want the data to be stored in an Access datatbase.
>
> I've loooked and looooked... but I can't find a simple
> script to do the above.
>
> I'm really new to ASP... so I don't have much clue what i
> should be doing.
>
> Any help would be appreciated.
>
> Thanks.
>
>
> Jam
GVaught Guest
-
Jammer #6
Re: Newbie question: I need an ASP script to store data from a form.
THANKS for that.
That's exactly what I wanted.
: )
Jammer Guest
-
Mario b. #7
Re: Newbie question: I need an ASP script to store data from a form.
Hi
Download and install Codejay from [url]http://www.codejay.com[/url]
"Jammer" <jammer20002@yahoo.co.uk> wrote in message
news:033301c3788b$b2ea4270$a101280a@phx.gbl...> I want to have a HTML form that the user fills in and
> clicks submit.
> I then want the data to be stored in an Access datatbase.
>
> I've loooked and looooked... but I can't find a simple
> script to do the above.
>
> I'm really new to ASP... so I don't have much clue what i
> should be doing.
>
> Any help would be appreciated.
>
> Thanks.
>
>
> Jam
Mario b. Guest
-
vladolf #8
Re: Newbie question: I need an ASP script to store data from a form.
I hate these code generators, if you have to use one write ot yourself if
you want to aviod alot of pointless, inflexible code in your asp. ;-)
"Mario b." <mariob@yomin.com> wrote in message
news:epCzDMReDHA.2324@TK2MSFTNGP12.phx.gbl...> Hi
>
> Download and install Codejay from [url]http://www.codejay.com[/url]
>
>
> "Jammer" <jammer20002@yahoo.co.uk> wrote in message
> news:033301c3788b$b2ea4270$a101280a@phx.gbl...>> > I want to have a HTML form that the user fills in and
> > clicks submit.
> > I then want the data to be stored in an Access datatbase.
> >
> > I've loooked and looooked... but I can't find a simple
> > script to do the above.
> >
> > I'm really new to ASP... so I don't have much clue what i
> > should be doing.
> >
> > Any help would be appreciated.
> >
> > Thanks.
> >
> >
> > Jam
>
vladolf Guest



Reply With Quote

