473,778 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML Form

Can someone help me with the code to take the data in four fields on an HTML
form and add it to a table in a database on an intranet.

Thanks to all who help!

Kathy
Nov 12 '05 #1
3 3720
Kathy,

You need file based access to the database from your Intranet server. From
there you will create two
pages, one that holds the form and fields, the second that holds the code to
connect to your mdb. Then execute an "INSERT" sql statement to get the data
into a table. If you are not familiar with any of that, you should look
into the ADO connection object. It would accomplish all of this easily if
you can use ASP or vbscript on the second page. It is important to keep in
mind that the code written on the second page runs only on the server and is
never shown to the user by means of using special tags that specify to
"runat" the server.

If you are running IIS on your intranet server then this is the vbscript for
Microsoft ASP pages...

First page: (firstpage.asp)
<html>
<body>
<p>Please fill in this data....</p>
<form name="myform" method="post" action="secondp age.asp">
<input name="fldFirstN ame" Value="">
<input name="fldLastNa me" Value="">
</form>
</body>
</html>

Second page: (secondpage.asp )
<%
dim cn
Set cnn1 = Server.CreateOb ject("ADODB.Con nection")
cnn1.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
Server.MapPath( "/somesubfolder/somedb.mdb") & ";Persist Security Info=False"
cnn1.execute "INSERT Into myTable FirstName, LastName VALUES(" &
request.form("f ldFirstName") & ", " & request.form("f ldLastName") & ")"
cnn.close
set cnn = nothing
response.write "<html><body><p >Thanks for adding that
data...</p></body></html>"
%>

You can replace the Server.MapPath( ) with the actual path to the mdb. The
tools are all there, it's just
a matter of learning! Let me know if you need any more help with that.

Good Luck!!

Jerry Boone
je***@antech.bi z.nospam (remove .nospam before sending)
President - Analytical Technologies, Inc.
ASP, ASP.NET, SQL Server Hosting
http://www.antech.biz

"Kathy" <kd******@earth link.net> wrote in message
news:a_******** *********@newsr ead2.news.atl.e arthlink.net...
Can someone help me with the code to take the data in four fields on an HTML form and add it to a table in a database on an intranet.

Thanks to all who help!

Kathy

Nov 12 '05 #2
Jerry,

Thank you very much for the response!!

I normally see a Submit button on a form like this but I don't see one here.
What causes the code on the second page to execute after the user fills in the
fields on the first page?

Can this be done with DAO and without ASP?

Thanks!

Kathy


"Jerry Boone" <je***@antech.b iz.killspam> wrote in message
news:MO******** ************@ne wssvr11.news.pr odigy.com...
Kathy,

You need file based access to the database from your Intranet server. From
there you will create two
pages, one that holds the form and fields, the second that holds the code to
connect to your mdb. Then execute an "INSERT" sql statement to get the data
into a table. If you are not familiar with any of that, you should look
into the ADO connection object. It would accomplish all of this easily if
you can use ASP or vbscript on the second page. It is important to keep in
mind that the code written on the second page runs only on the server and is
never shown to the user by means of using special tags that specify to
"runat" the server.

If you are running IIS on your intranet server then this is the vbscript for
Microsoft ASP pages...

First page: (firstpage.asp)
<html>
<body>
<p>Please fill in this data....</p>
<form name="myform" method="post" action="secondp age.asp">
<input name="fldFirstN ame" Value="">
<input name="fldLastNa me" Value="">
</form>
</body>
</html>

Second page: (secondpage.asp )
<%
dim cn
Set cnn1 = Server.CreateOb ject("ADODB.Con nection")
cnn1.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
Server.MapPath( "/somesubfolder/somedb.mdb") & ";Persist Security Info=False"
cnn1.execute "INSERT Into myTable FirstName, LastName VALUES(" &
request.form("f ldFirstName") & ", " & request.form("f ldLastName") & ")"
cnn.close
set cnn = nothing
response.write "<html><body><p >Thanks for adding that
data...</p></body></html>"
%>

You can replace the Server.MapPath( ) with the actual path to the mdb. The
tools are all there, it's just
a matter of learning! Let me know if you need any more help with that.

Good Luck!!

Jerry Boone
je***@antech.bi z.nospam (remove .nospam before sending)
President - Analytical Technologies, Inc.
ASP, ASP.NET, SQL Server Hosting
http://www.antech.biz

"Kathy" <kd******@earth link.net> wrote in message
news:a_******** *********@newsr ead2.news.atl.e arthlink.net...
Can someone help me with the code to take the data in four fields on an

HTML
form and add it to a table in a database on an intranet.

Thanks to all who help!

Kathy


Nov 12 '05 #3
Sure, you can drop a submit button on and that will be fine. Anything that
submits the <form> will post the data to the server. The Action element in
the <form> tags tells the page to submit TO secondpage.asp. When
secondpage.asp is being loaded, it reads in the form elements and their
values, then pokes them into the database by using
request.field(" somefieldname") .

I only work with ASP so I don't know about using something else. ASP is
enabled on every version of Windows... Win98 (by use of Personal Web
Server), NT4 Workstation (by use of Personal Web Server from resource kit),
NT4 Server (IIS3,4,5), Win2K(IIS 5,6), and XP Pro (IIS6). Once you do that,
you can access your intranet by using http://myservername/sompage.asp (or
html). It's really easy.

You should be able to use DAO components for data transfer, but your on your
own there. ADO is my first choice because it's heavily documented, has
multiple ways to do things, and by nature is designed for this task. It
also contains way more features for other operations, including xml and
offline file based recordsets that are portable and can be re-instantiated
for use. Too much to list on that stuff, books are written just to cover
these components....

:)

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
"Kathy" <kd******@earth link.net> wrote in message
news:_W******** *********@newsr ead1.news.atl.e arthlink.net...
Jerry,

Thank you very much for the response!!

I normally see a Submit button on a form like this but I don't see one here. What causes the code on the second page to execute after the user fills in the fields on the first page?

Can this be done with DAO and without ASP?

Thanks!

Kathy


"Jerry Boone" <je***@antech.b iz.killspam> wrote in message
news:MO******** ************@ne wssvr11.news.pr odigy.com...
Kathy,

You need file based access to the database from your Intranet server. From there you will create two
pages, one that holds the form and fields, the second that holds the code to connect to your mdb. Then execute an "INSERT" sql statement to get the data into a table. If you are not familiar with any of that, you should look
into the ADO connection object. It would accomplish all of this easily if you can use ASP or vbscript on the second page. It is important to keep in mind that the code written on the second page runs only on the server and is never shown to the user by means of using special tags that specify to
"runat" the server.

If you are running IIS on your intranet server then this is the vbscript for Microsoft ASP pages...

First page: (firstpage.asp)
<html>
<body>
<p>Please fill in this data....</p>
<form name="myform" method="post" action="secondp age.asp">
<input name="fldFirstN ame" Value="">
<input name="fldLastNa me" Value="">
</form>
</body>
</html>

Second page: (secondpage.asp )
<%
dim cn
Set cnn1 = Server.CreateOb ject("ADODB.Con nection")
cnn1.Open "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=" &
Server.MapPath( "/somesubfolder/somedb.mdb") & ";Persist Security Info=False" cnn1.execute "INSERT Into myTable FirstName, LastName VALUES(" &
request.form("f ldFirstName") & ", " & request.form("f ldLastName") & ")"
cnn.close
set cnn = nothing
response.write "<html><body><p >Thanks for adding that
data...</p></body></html>"
%>

You can replace the Server.MapPath( ) with the actual path to the mdb. The tools are all there, it's just
a matter of learning! Let me know if you need any more help with that.

Good Luck!!

Jerry Boone
je***@antech.bi z.nospam (remove .nospam before sending)
President - Analytical Technologies, Inc.
ASP, ASP.NET, SQL Server Hosting
http://www.antech.biz

"Kathy" <kd******@earth link.net> wrote in message
news:a_******** *********@newsr ead2.news.atl.e arthlink.net...
Can someone help me with the code to take the data in four fields on
an HTML
form and add it to a table in a database on an intranet.

Thanks to all who help!

Kathy



Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2158
by: Hansan | last post by:
Hi all, I hope you have time to help me out a little. My problem is that I want to combine some python code I have made with some html templates, I found a tutorial at dev shed: http://devshed.spunge.org/Server_Side/Python/CGI/page6.html and : http://devshed.spunge.org/Server_Side/Python/CGI/page5.html and tried to do it like they do, but it doesn't work. I used the same code they use for making the two display functions and the same...
5
6089
by: Richard Cornford | last post by:
I am interested in hearing opinions on the semantic meaning of FORM (elements) in HTML. I have to start of apologising because this question arose in a context that is not applicable to the Internet. Specifically, marking up a document that will contain multiple related form controls (intended exclusively for client-side scripting) that would never be intended to be submitted. I realise that that concept is a non-starter in an Internet...
16
2926
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the form order to do that ? My point is for the client to be able to re-read the modified data.
17
2496
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a fight to make it do anything or did I do something wrong? It would seem silly to have to create a...
4
2005
by: Sathyaish | last post by:
I am no JavaScript progammer, and unfortunately am having to babysit an old code base that has a lot of JavaScript in it. I have two questions: (1) Can two HTML controls have the same name? It looks like the obvious answer is NO. (2) What if? What if the developer has given two HTML controls the same name, i.e has created the same button more than once with exactly the
7
2791
by: thersitz | last post by:
I can't seem to get my html form to submit properly from within a web form. Here's my form tag syntax and some delivery hidden fields. <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi" method="POST" onsubmit="return verify();"> <input type="hidden" name="recipient" value=me@mymail.net /> <input type="hidden" name="redirect" value="http://www.xxx.org/forms/confirmation.htm" /> .......................
19
248261
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect this data is essential to any developer. This article is a basic tutorial on how to user HTML Forms, the most common method of data collection. Assumptions - Basic HTML knowledge. - Basic PHP knowledge. HTML Forms A common and simple way of...
1
2780
by: Arpit Nagar | last post by:
Hi... I am creating a dummy project for collage. Here I had choosen my project as Jewelleryshoping. Now the scenerio is like that thier are jewellry item which I had display in table format with images using form tag for button. Now the case is like I dont want to use any database like sql,serversite,php etc. I just want to use html or javascript or extremely XML. Now I want that When any person select Add to cart to particular...
10
6977
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
9
2520
by: dhtml | last post by:
I have written an article "Unsafe Names for HTML Form Controls". <URL: http://jibbering.com/faq/names/ > I would appreciate any reviews, technical or otherwise. Garrett -- comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >
0
9632
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7478
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.