Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DbiSaveChanges and Abort against TTable 1

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
This follows on from a different posting of mine (new thread as a new problem). :)

I have a DataModule with a number of TTable components. Against them I make use of the 'Abort' call ('BeforeDelete'/'BeforeInsert' events) such that the user cannot add or delete rows from a displayed grid.
In addition I'm allowing addition / deletion of entries through code (making use of a variable to by-pass the 'BeforeDelete'/'BeforeInsert' events) - behind the 'AfterPost'/'AfterDelete' actions I've placed a "DbiSaveChanges()" call [this has meant adding 'BDE' to my units used].
Now when I compile the code I'm presented with the error "Statement expected, but expression of type 'Integer' found" and the error points to the 'Abort' call. This was previously OK prior to adding the 'BDE' usage and 'DbiSaveChanges' call - now I have hit this problem.

Can anyone tell me what I've done wrong and how to rectify this issue ?

Thanks in advance
Steve
 
Which version of Delphi are you using?

Can you supply the code that is causing the problem?

Andrew
 
It's Delphi 5.
Not got the code a hand to post - but it's no more complex than I've indicated above - a TTable component with 'BeforeInsert'/'BeforeDelete' event consisting of the 'Abort;' call. This compiles and operates OK.
It's when I then add the 'DbiSaveChanges()' behind the 'AfterPost'/'AfterDelete' events (having to add 'BDE' to the uses clause) when things go wrong for me - throwing the error as listed in my first posting. :(
Steve
 
Try prefixing the Abort with SysUtils:
Code:
  SysUtils.Abort;
This will tell the compiler to use the one from SysUtils.pas instead of the one from BDE.pas (which is defined as a constant).

Andrew

 
towerbase - Thanks for that - I'm now able to do what I set out to do.
You are a star (and worthy of one!)
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top