Adding new records into SQL Server
Adding new records into SQL Server
New records (not blobs) can be added using the AddNew function.
Here’s the code to insert a new code into the MSSQL database.
Set conn = Server.CreateObject("ADODB.Connection")
cn.Open "DSN=myDSN;UID=sa;PWD=;DATABASE=pubs"
Set rs = Server.CreateObject("ADODB.Recordset")
Rs.open "Employee", conn, 1,3
Rs.addnew
Rs("name") = request.form("empname")
Rs("position") = request.form("position")
Rs.update
Rs.close
No comments:
Post a Comment