Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Stored Proc Return RS with all records
Message
 
 
To
20/03/2004 23:02:49
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00888256
Message ID:
00888286
Views:
10
Hi João,

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 ado 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
>
>
>João Batista
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform