Re: Arguments are of the wrong type message using TADODataSet for simple stored procedure



Hi Paul,

You have not defined anything to return. @nTest is parameter, not a result
value.

Here's a couple of examples:

//-- Stored Proc that returns the Log Space.

Create Procedure dbo.TransLogSpace_SP
@DB_Name VarChar(100) = Null
As
Create Table #MyLog
(
[Database Name] Varchar(50) Null,
[Log Size (MB)] Float Null,
[Log Space Used (%)] Float Null,
[Status] Int
)
Insert Into #MyLog
Exec ('DBCC SQLPERF ( LOGSPACE )')
If @DB_Name Is Not Null
Begin
Select * From #MyLog Where [Database Name] = @DB_Name
End Else Begin
Select * From #MyLog
End

//--Delphi Code to execute
AdoQuery.SQL.Text := 'Exec TransLogSpace_SP ''Master'' ';
AdoQuery.Open ;


//-- Insert a new record and return the record's new Identity value.

Create Procedure [dbo].[NewRDSOFilterRec_SP]
@Descr VarChar(50),@Tp Varchar(10)
As
Insert Into RDSOFilters
(Descr,[Type])
Values
(@Descr,@Tp)
/* Return New ID */
Select SCOPE_IDENTITY() As NewID

//--Delphi Code

AdoQuery.SQL.Text := 'Exec NewRDSOFilterRec_SP ''Hello'',''Type'' ';
AdoQuery.Open ;
AdoQuery.FieldByName('NewID').AsInteger ;

-Steve-


.