![]() | Products |
| Home » Technical Support » ElevateDB Technical Support » Incident Reports » Incident Reports Addressed for Version 2.18 » View Incident Report |
| Reported By: Terry Swiers Reported On: 11/10/2014 For: Version 2.18 Build 1 |
procedure TForm10.Button1Click(Sender: TObject);
procedure SetUnposted;
var
Q : TEDBQuery;
begin
Q := GetQueryObject;
Q.SQL.Text := 'update ar set unposted = 1 where transtype = 4 and transnum = 1';
Q.ExecSQL;
Q.Free;
end;
var
T1: TEDBTable;
begin
T1 := GetTableObject('AR');
T1.IndexName := 'CustNum';
T1.Open;
T1.SetRange([1], [1]);
try
T1.Database.StartTransaction(EmptyEDBStringsArray);
T1.Locate('TransType;TransNum', VarArrayOf([4, 1]), []);
SetUnposted;
//SetUnposted; //Not sure if the second call is required, but it simulates our code if there are multiple references for the record being deleted
T1.Delete; //>>> the error will show up here
T1.Database.Rollback; //This is intentional just to make sure the database isn't accidentaly modified and can't reproduce any more.
except
on E: Exception do begin
T1.Database.Rollback;
ShowMessage(E.Message);
end;
end;
T1.Free;
end;
procedure TForm10.EDBSession1BeforeConnect(Sender: TObject);
begin
EDBSession1.LocalConfigPath := ExtractFilePath(ParamStr(0));
end;
procedure TForm10.EDBSession1Login(Sender: TObject; var UserName,
Password: string; var Continue: Boolean);
begin
UserName := 'administrator';
Password := 'EDBDefault';
end;
function TForm10.GetQueryObject: TEDBQuery;
begin
Result := TEDBQuery.Create(nil);
_SetConnectionInfo(Result);
end;
function TForm10.GetTableObject(TableName: String): TEDBTable;
begin
Result := TEDBTable.Create(nil);
_SetConnectionInfo(Result);
Result.TableName := 'AR';
end;
procedure TForm10._SetConnectionInfo(Obj: TEDBDBDataSet);
begin
SetConnectionInfo(Obj);
end;
procedure SetConnectionInfo(Obj: TEDBDBDataSet);
begin
Obj.SessionName := Unit1.Form10.EDBDatabase1.SessionName;
Obj.DatabaseName := Unit1.Form10.EDBDatabase1.DatabaseName;
end;This web page was last updated on Wednesday, April 8, 2026 at 04:38 AM | Privacy Policy © 2026 Elevate Software, Inc. All Rights Reserved Questions or comments ? |

