Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Stored Proc Return RS with all records
Message
From
21/03/2004 17:29:27
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00888256
Message ID:
00888336
Views:
7
Hi Sergey,

Im my Method SetCommandProperties, i have what you tell me,
tcStoredProc=Store Procedure Name.
LPARAMETERS tcStoredProc
WITH .oCommand
	.ActiveConnection=This.oConnection
	.CommandText=tcStoredProc
	.CommandType = adCmdStoredProc
ENDWITH
João Batista

>You get all records because you don't call stored procedure but reference a table directly. Try
>...
> WITH .oCommand
> .ActiveConnection = .oConnection
> .CommandType = adCmdText
> .CommandText = [usr_sp_lstVendasCliente]
> .Parameters("@param1").Value = tcparam
> toRS = .Execute()
> ENDWITH
>>Hi all
>
>I create a stored proc and it works as expeted in Query Analyser, when i call it with ActiveX Data Objects command, it returns all records from table.
>
>Sample code here
>
>StoreProc:
>
>CREATE PROCEDURE usr_sp_lstVendasCliente @Param1 nvarchar(5)
>AS
> Select * From tbl_gc_DocumentosLinTer Where c_cod_ter = @Param1 order by c_num_doc
>GO
>
>Program Code:
>
> toRS.ActiveConnection = .oConnection
> toRS.Source=tcTabela
> .SetRecordSetProperties(toRS)
> toRS.Open
>
> .SetCommandProperties(tcStoredProc)
> .oCommand.Parameters("@param1").Value=tcparam
> toRs=.oCommand.Execute
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform