Предложите хранимую процедуру, которую вы можете вызвать из ASP.
CREATE PROC UpdateEmp
@EmpID int,
@LastName varchar(50),
--all the others properties you need to update this person
AS
BEGIN
UPDATE Employee
SET Alias = LastName,
LastName = @LastName,
--all the other properties you want updated.
WHERE PeopleID = @EmpID;
END
Вызовите этот хранимый процесс в вашем коде ASP следующим образом:
Dim cmd
Dim ln
Dim retCount
Dim conn
Set conn= Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")
conn.Open "some connection string"
With cmd
.ActiveConnection = conn
.Commandtext = "UpdateEmp"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@EmpID", adInteger, adParamInput, 10)
.Parameters("@EmpID") = 22 'some Employee you get from your code
.Parameters.Append .CreateParameter("@LastName", adVarChar, adParamInput, 50)
.Parameters("@LastName") = "MyLastName" 'some Employee you get from your code
.Execute ln, , adExecuteNoRecords
End With
Set cmd = Nothing