catastrophic failure : MSSQL 2005 Ent. 64bit on Win2003 64

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
eric_7410
Posts: 1
Joined: Fri 19 Jun 2009 09:18

catastrophic failure : MSSQL 2005 Ent. 64bit on Win2003 64

Post by eric_7410 » Fri 19 Jun 2009 10:31

When I installed new system, I meet this problem..
using on executing a Stored procedure in my transaction,
throws following erros, couple moment..

EOLEDBError Catastrophic failure.

as a result I was traced call stack, error throws in following codes..

Code: Select all


  receiptID := ''; 
  if isFinished then Exit; 


  dmDB.MSConn.StartTransaction; 
  try 
    try 
      quReceipt.ParamByName('Store_StationID').AsInteger := TGlobalEnv.Store_StationID; 
      quReceipt.ParamByName('Time_Section').AsInteger := TGlobalEnv.Time_Section; 
      quReceipt.ParamByName('Date_Number').AsString := TGlobalEnv.Date_OpenAccount; 
      quReceipt.ParamByName('MemberID').AsInteger := TUser.Instance.UserID; 
      quReceipt.ParamByName('Total_Price').AsCurrency := edtDue.EditValue; 
      quReceipt.ParamByName('SUM_TAX').AsCurrency := Cart.getTax; 
      quReceipt.ParamByName('DC').AsCurrency := FDC; 
      quReceipt.ParamByName('is_DC_Percent').AsBoolean := isDCPercent; 
      quReceipt.ParamByName('newRECEIPTID').AsString := receiptID; 
      quReceipt.Execute; { Here!! Error Throws.. }
      if quReceipt.ParamByName('RETURN_VALUE').AsInteger  0 then raise Exception.Create('Ununified Error'); 
... 
 

The stored procedure is like this..

Code: Select all

ALTER PROCEDURE      [dbo].[usp_RECEIPT_INSERT] 
(    
   @Store_StationID INT, 
   @Time_Section TINYINT, 
    @Date_Number VARCHAR(6), 
   @MemberID INT = NULL, 
   @Total_Price MONEY = NULL, 
   @SUM_TAX MONEY = NULL, 
   @DC MONEY = NULL, 
   @is_DC_Percent BIT = NULL, 
   @newRECEIPTID VARCHAR(14) = NULL OUTPUT 
) as 
   DECLARE @ERROR INT 

   --make new receipt no 
    
   SELECT   @newRECEIPTID = 
      RIGHT('0' + CAST(@Store_StationID AS VARCHAR(2)), 2) + 
      RIGHT('0' + CAST(@Time_Section AS VARCHAR(2)), 2) + 
      @Date_Number + 
            RIGHT('000' + 
               CAST( 
                  CAST(ISNULL(RIGHT(MAX(RECEIPTID),4), '0000') AS INT) + 1 AS VARCHAR(4) 
               ) 
            ,4) 
   FROM   RECEIPT 
   WHERE   RECEIPTID LIKE RIGHT('0' + CAST(@Store_StationID AS VARCHAR(2)), 2) + 
                RIGHT('0' + CAST(@Time_Section AS VARCHAR(2)), 2) + 
               @Date_Number + '%' 


   SET @ERROR = @@ERROR    
   IF @ERROR  0 RETURN @ERROR 

   INSERT   INTO RECEIPT 
      (RECEIPTID 
      ,STORE_STATIONID 
      ,MemberID 
      ,REG_DATETIME 
      ,TOTAL_PRICE 
      ,SUM_TAX 
      ,DC 
      ,is_DC_Percent 
      ) 
      VALUES( 
         @newRECEIPTID 
         ,@Store_StationID 
         ,@MemberID 
         ,getdate() 
         ,@Total_Price 
         ,@SUM_TAX 
         ,@DC 
         ,@is_DC_Percent 
          
      ) 

   SET @ERROR = @@ERROR    
   IF @ERROR  0 RETURN @ERROR 

   RETURN @ERROR 
RETURN 



sorry for my poor code...
please solve that problem..
Thx!!

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 19 Jun 2009 12:32

I can not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill table.

Also supply me the following information:
- the exact version of SDAC. You can see it in the About sheet of TMSConnection Editor;
- the exact version of your IDE;
- the exact version of SQL server and client. You can see it in the Info sheet of TMSConnection Editor.

Post Reply