|
|
|
| Текст процедуры такой
CREATE PROCEDURE dbo.Already_Assigned
@This int
AS
declare @rows_aff Int
set nocount on
UPDATE dbo.act_contact
Set dbo.act_contact.assign = 1
From dbo.ajoin_mev_person
Where dbo.act_contact.accountno = dbo.ajoin_mev_person.accountno AND
dbo.ajoin_mev_person.this_ev_id = @This;
set @rows_aff = (SELECT @@rowcount)
return @rows_aff
GO
|
Код для вызова:
Public conn As Connection
Public cmd As ADODB.Command
Public prm, prm2 As ADODB.Parameter
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "dbo.Already_Assigned"
cmd.CommandType = adCmdStoredProc
Set prm = cmd.CreateParameter("This", adInteger, adParamInput, 4, This_event)
cmd.Parameters.Append prm
Set prm2 = cmd.CreateParameter("rows_aff", adInteger, adParamOutput, 4)
cmd.Parameters.Append prm2
cmd.Execute
|
Получаю ошибку "Procedure Already_Assigned has too many arguments specified."
Может быть, я неправильно с точки зрения Access объявил переменные в хп. Тогда как правильно? | |
|
| |
|
|
|
|
| объявить
CREATE PROCEDURE dbo.Already_Assigned
@This int ,@rows_aff Int output
AS
--declare @rows_aff Int | |
|
| |