Solved

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

Posted on 2004-09-20
4
1,075 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
[X]
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
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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