Can anyone tell me how to execute a stored procedure with a parameter within VB6 code.
This code executed the procedure prior to the parameter being added.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Qy As New ADODB.Command
Set Qy.ActiveConnection = cn
Qy.CommandType = adCmdStoredProc
Qy.CommandText = "sp_insert_MainItems_1;1"
Set rs = Qy.Execute
CurrentSKU = rs!SKU
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
The stored procedure is as follows (SKU being the parameter).
CREATE PROCEDURE [sp_insert_MainItems_1] @SKU char
AS
Select * From MainItems
Where MainItems.SKU = @SKU
I need to pass a parameter of 143149 to the procedure.
If anyone can help I would be most greatful.
Regards
MattN
This code executed the procedure prior to the parameter being added.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim Qy As New ADODB.Command
Set Qy.ActiveConnection = cn
Qy.CommandType = adCmdStoredProc
Qy.CommandText = "sp_insert_MainItems_1;1"
Set rs = Qy.Execute
CurrentSKU = rs!SKU
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
The stored procedure is as follows (SKU being the parameter).
CREATE PROCEDURE [sp_insert_MainItems_1] @SKU char
AS
Select * From MainItems
Where MainItems.SKU = @SKU
I need to pass a parameter of 143149 to the procedure.
If anyone can help I would be most greatful.
Regards
MattN