Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call Stored Proc Return RS with all records
Message
De
21/03/2004 17:29:27
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00888256
Message ID:
00888336
Vues:
8
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
>
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform