Re:Getting MSSQL 7 Stored Proc output parameters
On Tue, 13 Nov 2001 12:00:14 +0100, "Alain FAJNER" <afaj...@yahoo.fr>
wrote:
Quote
>I have a Delphi 5 program which is connected to a SQL Server 7 (MSDE)
>database through the standard SQL Links.
>I have written a stored proc that has only output parameters. Its definition
>is :
>CREATE PROCEDURE GENERE_EXPORT @Num_export INT OUTPUT, @DateHeure DATETIME
>OUTPUT, @Tot_ref INT OUTPUT, @Tot_moules_casses INT OUTPUT,
>@Tot_moules_entres INT OUTPUT AS
>When I run this procedure from the SQL Server query analyzer, I get the
>right results.
>In my Delphi code, I use a TStoredProc component.
>On the TStoredProc.Open instruction, I get an EDatabaseError exception with
>the message "no type for the '@Num_export' parameter" (or something like
>that since I have translated it from French to English).
First of all, since your stored procs doesn't return a result set, do
not use the "Open" method, but rather use the "ExecProc" call instead.
Quote
>Althoug it works fine with ADO components, I wouldn't like to use those
>components since I have to rewrite a large part of my code.
If you want to do anything that has been introduced in SQL Server 7 or
2000 (such as text fields longer than 255 chars, any of the newer
datatypes etc.), you will HAVE TO switch to ADO. It is the preferred
and supported way to access SQL Server after v6.5 - sooner or later,
it will be the only way to do so...
Marc
------------------------------------------------------------------------
Marc Scheuner Software Engineer
Quest Software Canada Halifax, Nova Scotia, Canada
Email: marc.scheu...@quest.com http://www.quest.com