Hello
If you are wants add records by clicking on link then call a Javascript
method to submit the form . which will takes the value from the form and
passed to asp files which will add records to databse. User <a
href="javascript:AddRecords();">Add to Database</a>
> i want to add record in the database by clicking on link how to do that?
basic method is:
in your html page where you enter the record:
...
<form action="saveRecord.asp" method="post">
...
place all your form fields in here
...
place your submit button here
</form>
...
Now, in saveRecord.asp, do something like:
<%
strFirstField = Request.Forms("myFirstFormFieldName")
strNextField = Request.Forms("myNextFormFieldName")
...
' place lines like above in here, one for each form field
' so you get the value from each field into a variable
...
' connect to database
...
strSQL = "INSERT INTO myTableName(field1, field2, ...) VALUES (" _
& "strFirstField" & ", " & strNextField & ")"
connection.execute strSQL
' close connection
' Response.Redirect("myNextPage.htm")
%>
This should give you the right idea (without details of your database
engine, fields etc, it's very hard to write actual working code for you).
HTH,
Col
-----Original Message-----
From: Abhijit [mailto:abhijitvijay@l...]
Sent: 31 July 2002 10:54
To: ASP Databases
Subject: [asp_databases] Re: how to add record in database
Hello
If you are wants add records by clicking on link then call a Javascript
method to submit the form . which will takes the value from the form and
passed to asp files which will add records to databse. User <a
href="javascript:AddRecords();">Add to Database</a>
> i want to add record in the database by clicking on link how to do that?
*******
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.
For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.