How to add a button to Modify, delete or add a new record to this code
am 01.10.2005 09:25:58 von karenmiddleolThe following code works fine I can connect to a SQL database and list
all the records in the Orders table onto a web page.
Now our users want me to modify it so that each row displayed as a
button or a hyperlink for Modify, Delete and also they want the data
displayed not in a HTML table as I am doing but like in a form they
want the ability to change the data in the fields. So when the user
clicks on the modify button for a row then they want to capture what is
on the screen and update the database table.
Similarly, if they click the delete button or hyperlink on a row they
want it deleted.
Also, at the end of displaying all records in the table they want a
button or link to insert a new record.
Can you kindly let me know the changes to this code to accomplish this.
Thanks
Karen
<%
dim cn, rs, sql
dbname = "NorthWind"
Cn = "provider=SQLOLEDB;network=DBMSSOCN;"
Cn = Cn & "uid=sa;pwd=sa;server="
Cn = cn & "testserver;database=" & "NorthWind"
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from Orders"
rs.Open sql, cn
%>
OrderID | CustomerId | ShipName | ShipCity | ShipCountry |
<%= rs("OrderId") %> | <%= rs("CustomerId") %> | <%= rs("ShipName") %> | <%= rs("ShipCity") %> | <%= rs("ShipCountry") %> |
<%
rs.close
set rs=nothing
%>