本教程是一篇asp入門篇的初級教程了
Function add_del_update(tablename
Select Case str
Case "insert":
sql="select * from ["&tablename&"] where id=null"
rs
rs
For Each key In request
response
rs(CStr(key))=request(key)
Next
rs
rs
Case "update":
sql="select * from ["&tablename&"] where id="&id
rs
For Each key In request
if key<>"id" then
rs(CStr(key))=request(key)
end if
Next
rs
rs
Case "delete":
sql="delete from ["&tablename&"] where id in("&id&")"
rs
Case ""
End Select
End Function
%>
<%
向table
call add_del_update("table
修改table
id=request("id")
call add_del_update("table
刪除table
id=request("id")
call add_del_update("table
%>
From:http://tw.wingwit.com/Article/program/net/201311/14128.html