Calling Stored Procedures with parameters

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
nxbm
Posts: 1
Joined: Thu 22 Nov 2012 13:20

Calling Stored Procedures with parameters

Post by nxbm » Thu 22 Nov 2012 13:38

Hello

We're using the latest version of the dbExpress driver for MSSQL (6.0.1.0) and I just encountered a very strange problem. We're using Delphi XE as our IDE.

When calling a Stored Procedure with parameters using the TSQLStoredProc component, we received the error message

Actual number of parameters (1) exceeds the current number of stored procedure parameters (0). Either uncheck the ParamCheck component property or review the parameter list content.

We only got the error when using SQL Server Authentication. Using Windows Authentication everything worked just fine. The number of used parameters did also exactly match the numbers of parameters in the Stored Procedure.

Our temporar solution was to set the ParamCheck property in the TSQLStoredProc component to false.

Is this the correct behaviour of the driver? Please advice.

Björn Möller

AndreyZ

Re: Calling Stored Procedures with parameters

Post by AndreyZ » Thu 22 Nov 2012 15:43

Hello,

To solve the problem, you should set the SchemaOverride connection parameter to '%.dbo' . Here is a code example:

Code: Select all

SQLConnection1.Params.Values['SchemaOverride'] := '%.dbo';

Post Reply