Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

TSQLConnection 100 POINT -->"StartTransaction","Rollback","Commit"

Posted on 2004-09-20
4
1,055 Views
Last Modified: 2007-12-19

Hi All
I'm Having this problem with TSQLConnection

i want to know how to do "StartTransaction","Rollback","Commit" it's not working with me i get error as soon as i use this line of code:

  dbIncalls.StartTransaction(TD_INCALLS);

Appreciate your help

Here is the code :

//---------------------------------------------------



type
  TTransIsolationLevel = (xilDIRTYREAD, xilREADCOMMITTED, xilREPEATABLEREAD, xilCUSTOM);
  TTransactionDesc = packed record
     TransactionID    : LongWord;
     GlobalID         : LongWord;
     IsolationLevel   : TTransIsolationLevel;
     CustomIsolation  : LongWord;
  end;

...
...
...
...




private
    { Private declarations }
    dbIncalls:TSQLConnection;
    DBoperdb:TSQLConnection;


...
...
...
...






Procedure un_Process_Thread.Start_Processing;
Var
  TD_INCALLS:TTransactionDesc;
  TD_OPERDB:TTransactionDesc;
Begin
  if not Connect_TO_DB then exit;
  Log_File_Name:=GET_LOG_FILENAME;
  TD_INCALLS.TransactionID  :=  1;
  TD_INCALLS.IsolationLevel := xilREADCOMMITTED;
  dbIncalls.StartTransaction(TD_INCALLS);

  TD_OPERDB.TransactionID  :=  1;
  TD_OPERDB.IsolationLevel := xilREADCOMMITTED;
  DBoperdb.StartTransaction(TD_OPERDB);
  if not Lock_Processed_File(Process_File_Name,Process_File_ID) then
    Begin
      dbIncalls.Rollback;
      DBoperdb.Rollback;
      exit;
    end;

end;
0
Comment
Question by:Balshe
  • 2
4 Comments
 
LVL 1

Author Comment

by:Balshe
ID: 12101045
here is the error message i get


 un_Process_Thread_UNIT.pas(323): Incompatible types: 'DBXpress.TTransactionDesc' and 'un_Process_Thread_UNIT.TTransactionDesc'
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12101272
What kind is the Database that you use ?
0
 
LVL 6

Accepted Solution

by:
vadim_ti earned 100 total points
ID: 12101290
you need to delete type declarations for TTransIsolationLevel  and TTransactionDesc
from your unit

and to include
uses DBXpress
into your unit interface section
0
 
LVL 1

Author Comment

by:Balshe
ID: 12101418
Thanks a lot

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
drawing animated level bar based on numbers 3 103
Adoquery sql  left join does not work 25 99
Tvertscrollbox like a whatsapp layout 5 34
MS Access from Delphi 31 60
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question