I get an error when I enter a record in the table “empresa2” or updating a record.
I am using “Sql Server 2005” and Delphi 7.
Attached the sample project and the database script.
Hello,
Please can you check your attached testcase and modify it?
- Attach only one group project
- Use TDADMemDataTable instead of TDACDSDataTable
- Try to put to SQL actual db objects to decrease sql file size.
done.
Attach Debugger error screen. (Message in Spanish)
I think the problem is ntext columns. If I remove the ntext columns, the update runs smoothly. The problem should be on how to do the update with the Driver ADO.
Hello,
Thanks, the issue was logged as #52722
As a workaround please set DataStreamer.SendReducedDelta=True on client and server sides.
Hi,
Continuing with the error if you attempt to delete a record, to apply the changes the record is deleted but the server returns an error like that has not been possible.
Hello,
We couldn’t reproduce this error. Can you provide a full error message or a testcase?
Hi,
Step:
- Execute Prueba.
- Execute PruebaClient.
- Select DataSet Empresa.
- Press Insert to add new record.
- Press Aplicar for applyUpdates.
- Use Ctrl+Intro to delete record.
- Press Aplicar for applyUpdates.
- Error. See Screenshot.jpg file.
Use Database in script for last test2.rar file.
Hello,
Please try to test attached project. Does it work properly?
What DA version do you use?
Hi,
it don’t work…
See screenshot in attach file.
thanks.
I think the problem is Adocommand in server, the command returns Affectrows = 0, and this causes the error returned from server to client.
Hello,
Add BeforeExecuteDeltaCommand event to TPruebaService and check the following values:
procedure TPruebaService.DataAbstractServiceBeforeExecuteDeltaCommand(
const Sender: IDASQLCommand);
begin
//Sender.Params
//Sender.SQL
end;
The error reson is ‘update’ doesn’t modifies any recors.
Can you execute this sql manually with parameters?
Hello,
The record is always deleted, The probleme is after, which is detected as nothing happened.
// mi code
procedure TPruebaService.DataAbstractServiceBeforeExecuteDeltaCommand(
const Sender: IDASQLCommand);
var str:string;
p1,p2:variant;
r:integer;
begin
str:=sender.SQL;
r:=sender.Execute; /// ScreenShot
str:=str+‘sj’;
p1:=sender.Params[0].Value;
p2:=sender.Params[1].Value;
end;
I think the error is in this code (udaBussinnesProcessor)
// IBX returns -1 even if updates are successful! This started to happen after I plugged the GetNextAutoinc call above.
// If records fail, an exception is usually generated so this check for <>0 should be sufficient for all cases...
// DO NOT CHANGE this to >0 !!!!
— Rowaffected=0 then
if (rowsaffected<>0) or (poIgnoreRowsAffected in fProcessorOptions) then begin
if (change.ChangeType<>ctDelete) and (refds<>NIL) then begin
RefreshDeltaChange(aConnection, refds, aDelta, change, autoincvalue,lDefaultGeneratorName);
change.RefreshedByServer := TRUE;
canremove := False;
end;
---- Don’t enter into this code.
//canremove := not change.RefreshedByServer;
change.Status := csResolved;
if (ADeltaStruct <> nil) and (change.ChangeType in [ctInsert, ctUpdate]) and (lTargetTable <> '') then begin
for z:=0 to ADeltaStruct.Relationships.Count - 1 do
if aDelta.LogicalName = ADeltaStruct.Relationships[z].DetailDatasetName then
SynchronizeAutoIncs(aDelta,ADeltaStruct.fDetailDeltas[z], ADeltaStruct.Relationships[z]);
end;
Hello,
In your testcase you use Empresa table for inserting, but in screenshot you use Instrumental table for deleting.
Can you check it why it is? Can you attach a video how do you insert and update records in your testcase?
Hello,
The problem is repeated in “Empresa” and “Instrumental”. Create the video you say.
Hello,
See the video in attach file.
2M is too little for any video.
Hello,
I discovered what my problem. The problem is a “Trigger After Delete.” In implementing the deletion is possible to return the value of the last sentence in the “Trigger”. This problem is solved with SET NOCOUNT ON;
Thanks for your time.