Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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
 
Old October 27th, 2003, 05:25 AM
Registered User
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default SAVING VALUES FROM A TEXT BOX TO A DATABASE

i am new to asp. need a hand.
i have a frontpage form whereby i want to enter the name of a file into a text box and click on a button. this button will then add the name of the file to a field in an access database. i have all the page set up its just the actual vbscript i need to carry out the calulation
as i said im new so no fancy talk please. as simple as possible
 
Old October 27th, 2003, 11:17 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hiGary
first you write this code for a htm page (index.htm)
'''''''''''''code''''''''''''
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function ddd()
{
document.form1.action="normaldatabasecon.asp"
document.form1.submit()
}
//-->
</SCRIPT>

<BODY>
<form name=form1>
<input type=text name=email>
<input type=button Value=Submit id=button1 name=button1 onclick=ddd()>
</form>

</BODY>
</HTML>
'''''''''''''''''asp page (normaldatabasecon.asp''''''''''''''''''
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
email=Request("email")
str="dsn=SAMPLE;uid="";pwd="";"
dim c,r
set c=server.CreateObject("adodb.connection")
set r=server.CreateObject("adodb.recordset")
c.open str
sql="Insert into client(name) values ('"&email&"')"
c.Execute sql
msg="your data is successfully added"
%>
</BODY>
<%=msg%>
</HTML>
'''''''''''''''''''''''''
and create a access database
'''''''''''''''''''''''''
field name :name type : text
tablename :client
Make DSN :SAMPLE
'''''''''''''''''''

surendran
 
Old October 28th, 2003, 07:26 AM
Registered User
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can i ask what Make DSN : SAMPLE means?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Grab Values From List Box into Text Box phungleon VB How-To 2 June 19th, 2008 10:33 PM
Saving data from a text box Fairies2 C# 0 February 15th, 2007 04:38 AM
Text box values are different shoakat Classic ASP Databases 2 April 28th, 2005 12:29 AM
loop values and text box values move mateenmohd Classic ASP Basics 2 April 5th, 2005 11:33 PM
Saving Rich Text Box Formatting snowy0 VB.NET 2002/2003 Basics 5 February 29th, 2004 02:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.