vb6.0获取sqlserver存储过程的返回值
存储过程为:ALTERprocedure[dbo].[FPD161307Update_ManuManagerWorkTicketInsert]@F1nvarchar(20...
存储过程为:
ALTER procedure [dbo].[FPD161307Update_ManuManagerWorkTicketInsert]
@F1 nvarchar(20)
@F19 nvarchar(50)
as
begin
insert into [192.5.1.31].yccomsdata.ManuManager.WorkTicket(WorkTicketUID,TicketNo,ProcessNumber)
values (newid(),@F1,cast(@F19 as float));
if @@ROWCOUNT<>0 ----判断受影响行数属否为0
RETURN 1
else
RETURN 0
end;
VB中的代码:
Private Sub Command1_Click()
Set CONN = New ADODB.Connection
Set RS = New ADODB.Recordset
CONN.ConnectionString = "driver={sql server};server=192.5.1.9;uid=sa;pwd=***********.\;Database=NSTEST"
CONN.ConnectionTimeout = 50
CONN.Open
Dim str As String
Set RS.ActiveConnection = CONN
RS.CursorType = adOpenDynamic
str = "exec FPD161307Update_ManuManagerWorkTicketInsert 3311445566 ,13000"
RS.Open str
End Sub
我怎么取得存储过程返回的值,在VB中判断是否执行成功? 展开
ALTER procedure [dbo].[FPD161307Update_ManuManagerWorkTicketInsert]
@F1 nvarchar(20)
@F19 nvarchar(50)
as
begin
insert into [192.5.1.31].yccomsdata.ManuManager.WorkTicket(WorkTicketUID,TicketNo,ProcessNumber)
values (newid(),@F1,cast(@F19 as float));
if @@ROWCOUNT<>0 ----判断受影响行数属否为0
RETURN 1
else
RETURN 0
end;
VB中的代码:
Private Sub Command1_Click()
Set CONN = New ADODB.Connection
Set RS = New ADODB.Recordset
CONN.ConnectionString = "driver={sql server};server=192.5.1.9;uid=sa;pwd=***********.\;Database=NSTEST"
CONN.ConnectionTimeout = 50
CONN.Open
Dim str As String
Set RS.ActiveConnection = CONN
RS.CursorType = adOpenDynamic
str = "exec FPD161307Update_ManuManagerWorkTicketInsert 3311445566 ,13000"
RS.Open str
End Sub
我怎么取得存储过程返回的值,在VB中判断是否执行成功? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询