Recently I ran into an error using dbExpress’ SQLStoredProc component in Delphi 7. I got this error in the code after I called a stored procedure (where I expect a @return_value). I don’t have the same problem when I use SQL Server 2005 on the same PC with my EXE (it works fine); but when I run the EXE from a client PC I would get this error. I searched around online and I got a few suggestions like this “This is a known bug. I just went through this. Get the Corelab driver. It works as expected”. I downloaded the latest dbxsda425 (to replace my dbxsda420) but the problem didn't go away. I checked my MDAC on all my PCs and they are the latest version also.
The following is a sample of my code.
In Delphi: (dbExpProcessPayment is dbExpress' SQLStoredProc component)
-----------
try
dbExpProcessPayment.Close;
dbExpProcessPayment.StoredProcName := 'spAddBatchPayment';
dbExpProcessPayment.Params[1].Value := tmpBatchID;
dbExpProcessPayment.Params[2].Value := dmABS.ABSUserID;
try
dbExpProcessPayment.ExecProc;
except
on E: Exception do //write to error log
Showmessage('Error occurs while creating a new batch payment!');
end; //except
finally
wwDBCBatch_No.Value := dbExpProcessPayment.Params[0].Value;
End;
The stored procedure spAddBatchPayment in SQL Server:
------------------------------------------------------------------
CREATE PROCEDURE spAddBatchPayment
@BatchPaymentID varchar(14), @UserID varchar(25) AS
BEGIN
INSERT INTO Batch_Payment (Batch_Payment_ID, Create_Date_Time, Created_By)
VALUES (@BatchPaymentID, GETDATE(), @UserID)
RETURN @@IDENTITY
END
Could someone give me a suggestion? Thank you for your help.
List Index Out of Bound(0) error
Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Return to “dbExpress driver for SQL Server”
Jump to
- General Forums
- ↳ Announcements
- Database Tools
- ↳ dbForge for MySQL
- ↳ dbForge for Oracle
- ↳ dbForge for PostgreSQL
- ↳ dbForge for SQL Server
- ADO.NET Data Providers
- ↳ Entity Framework support
- ↳ LinqConnect (LINQ to SQL support)
- ↳ dotConnect for Oracle
- ↳ dotConnect for MySQL
- ↳ dotConnect for PostgreSQL
- ↳ dotConnect for SQLite
- ↳ dotConnect for DB2
- ↳ dotConnect for SQL Server
- ↳ dotConnect for Cloud Applications
- ↳ dotConnect Universal
- ↳ Entity Developer
- Delphi Data Access Components
- ↳ EntityDAC
- ↳ Universal Data Access Components
- ↳ Oracle Data Access Components
- ↳ SQL Server Data Access Components
- ↳ MySQL Data Access Components
- ↳ InterBase Data Access Components
- ↳ PostgreSQL Data Access Components
- ↳ SQLite Data Access Components
- ↳ VirtualDAC
- dbExpress Drivers
- ↳ dbExpress driver for Oracle
- ↳ dbExpress driver for SQL Server
- ↳ dbExpress driver for MySQL
- ↳ dbExpress driver for InterBase & Firebird
- ↳ dbExpress driver for PostgreSQL
- ↳ dbExpress driver for SQLite
- ODBC Drivers
- ↳ ODBC Drivers
- Network Security
- ↳ SecureBridge
- Developer Tools
- ↳ Code Compare
- ↳ Review Assistant
- ↳ LINQ Insight
- ↳ SSIS Data Flow Components
- ↳ Excel Add-ins