I´ve downloaded the latest version of the dbExpress MSSQL driver (3.00 trial) and tried to execute a stored procedure using Delphi 7 & SQL Server 2005 Express. Like the older versions, it´s still broken.
Here is the script to create the tables and stored procedure:
Code: Select all
CREATE TABLE NrContr2 (
CdCampo varchar(15) NOT NULL,
TamCampo numeric(2,0) NOT NULL,
UsaAno char(1) NOT NULL,
UltValor int NOT NULL,
Ano numeric(5,0) NOT NULL
)
GO
ALTER TABLE NrContr2
ADD CONSTRAINT PK_NrContr2 PRIMARY KEY (CDCampo)
GO
INSERT INTO NrContr2
VALUES
('ID',10,'S',0,2006)
GO
CREATE PROCEDURE stpProxNumero2(@Campo varchar(15), @ProxNumero int OUTPUT) AS
BEGIN
UPDATE NrContr2 SET UltValor = UltValor+1 WHERE CdCampo = @Campo
Select @ProxNumero = UltValor2 From NrContr WHERE CdCampo = @Campo
END
GO
Code: Select all
Name: Campo
DataType : ftString
ParamType: ptInput
Name: ProxNumero
DataType: ftInteger
ParamType: ptInputOutput.
Code: Select all
var
sNrContr, sCampo : String;
begin
sCampo := 'ID';
with SQLStoredProc1 do
begin
Params.ParamByName( 'Campo' ).AsString := sCampo;
Params.ParamByName( 'ProxNumero' ).AsString := sNrContr;
ExecProc;
end;
end;
Project Project1.exe raised exception class EMSError with message 'Invalid object name 'master.dbo.spt_provider_types'.
Is this a bug of the dbExpress driver, or what I´m doing wrong????
If it´s a bug, when will it be fixed? According to other posts the same error already occurred with earlier versions of the driver but it was supposed to be fixed in a new version which officially supports SQL Server 2005.
P.S. all the above works fine with SQL Server 2000