Advertisement
Advertisement
| 06.12.2008 at 05:31PM PDT, ID: 23481517 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: |
The code below fails at the If Not ado_rs.EOF Then line:
****************************************************************
Let ado_sql = "GetProcessSelection '" & Me.cboWorkOrder & "', '" & Me.cbo_pt_part & "', intProcessID, intProcessSelectID, intDesCapID"
ado_rs.Open ado_sql, dB_CONN, adOpenForwardOnly, adCmdText
If Not ado_rs.EOF Then
Do While Not ado_rs.EOF
strProcessID = ado_rs(0)
...
===============================================================
The stored procedure code is below.
===============================================================
ALTER PROCEDURE [dbo].[GetProcessSelection]
@wo_nbr VARCHAR(18)
, @pt_part VARCHAR(18)
, @ProcessID NVARCHAR(30) OUTPUT
, @ProcessSelectID varchar(30) output
, @DesCapID varchar(30) output
AS
DECLARE
@intDesCapID INTEGER
BEGIN
-- SET NOCOUNT to ON to no longer display the count message.
SET NOCOUNT ON;
--Check to see if DesCap is required
EXEC GetDesCapID @wo_nbr, @pt_part, @intDesCapID OUTPUT
IF @intDesCapID IS NULL --DesCap is NOT required
BEGIN
SELECT
@ProcessID = Process_ID
, @ProcessSelectID = Process_Select_ID
, @DesCapID = @intDesCapID
FROM Process_selection
WHERE pt_part = @pt_part
END --IF @intDesCapID IS NULL --DesCap is NOT required
ELSE
IF @intDesCapID IS NOT NULL --DesCap is required
BEGIN
SELECT
@ProcessID = Process_ID
, @ProcessSelectID = Process_Select_ID
, @DesCapID = @intDesCapID
FROM Process_selection
WHERE
Process_selection.pt_part = @pt_part
AND Process_selection.Tip =
(SELECT DesCap.Tip
FROM DesCap
WHERE
DesCap.DesCap_ID =
(SELECT wo_descap
FROM wo_mstr
WHERE
wo_nbr = @wo_nbr
AND wo_part = @pt_part
)
)
END -- IF @intDesCapID IS NOT NULL --DesCap is required
-- Reset SET NOCOUNT to OFF
SET NOCOUNT OFF;
END
===============================================================
As you can see the stored procedure calls another stored procedure which also has an output parameter. When I execute the GetProcessSelection stored procedure with the following statement in Query Analyzer it runs successfully:
===============================================================
exec GetProcessSelection '130907', 'ep-08', @strProcessID output, @intProcessSelectID output, @intDesCapID output
===============================================================
|