|
Subject:
|
SAVING VALUES FROM A TEXT BOX TO A DATABASE
|
|
Posted By:
|
Gary_M
|
Post Date:
|
10/27/2003 4:25:57 AM
|
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
|
|
Reply By:
|
surendran
|
Reply Date:
|
10/27/2003 10:17:41 PM
|
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
|
|
Reply By:
|
Gary_M
|
Reply Date:
|
10/28/2003 6:26:54 AM
|
can i ask what Make DSN : SAMPLE means?
|