Solved

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

Posted on 2004-09-20
4
1,036 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now