ApplyUpdates and Reconciliation of errors

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Tue 25 Apr 2006 14:22

Ok... got it thanks.

How do I go about compiling the packages?
I saw in the source directory a batch file corresponding to the Delphi 10 (2006) IDE. When I run it, I get the following output:

Code: Select all

C:\Program Files\CoreLab\MyDAC\Source\Delphi10>Make.bat
ECHO is off.
The device is not ready.
Press any key to continue . . .
What am I supposed to do that I am not doing?
I checked the script for possible path set wrongly, but it is all ok...

Any idea?
________
Love Quotes Forums
Last edited by david_labbe on Fri 18 Feb 2011 15:34, edited 1 time in total.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 27 Apr 2006 10:17

Try setting ECHO to ON to determine what string of the script causes error.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Sat 29 Apr 2006 08:49

Hi there,

I managed to apply the patch through the IDE. Works like a charm!. Thanks for your help and quick response.
________
Free Joomla Themes
Last edited by david_labbe on Thu 10 Mar 2011 10:09, edited 1 time in total.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Mon 01 May 2006 14:40

Hi again,

new issue:

Suppose I replace the TMyTable by a TMyStoredProcedure. How do I go about getting the Error reconciliation?

The idea is that I have 4 stored procedures
- spView to view
- spInsert to insert the data
- spUpdate to update the data
- spDelete to delete the data.

I thus connect the spView to the DataSetProvider and set a BeforeUpdateRecord event on the DataSetProvider such that:

Code: Select all

  case UpdateKind of
    ukInsert :
      with spInsert do
          { Cycle through all parameters in the stored proc and match to
            fieldname in CDS for assignment }
          for i:=0 to ParamCount - 1 do
            if Params[i].ParamType = ptInput then
              begin
                FieldName := Params[I].Name;
                if DeltaDS.FindField(FieldName)  nil then
                  Params[I].Value := DeltaDS.FieldByName(FieldName).NewValue;
              end;
            ExecProc;
            Applied := true;
        end;

  ukModify :
    with spUpdate do
        { Cycle through all parameters in the stored proc and match to
          fieldname in CDS for assignment }
        for I:=0 to ParamCount - 1 do
          if Params[I].ParamType = ptInput then
            begin
              FieldName := Params[I].Name;
              if DeltaDS.FindField(FieldName)  nil then
                { If NewValue is assigned (either to Null or an updated
                  value, assign it to the parameter.  Otherwise, keep
                  the OldValue of the field and return it in the
                  UPDATE statement of the stord proc. }
                if (VarIsEmpty(DeltaDS.FieldByName(
                  FieldName).NewValue)=False) then
                  Params[I].Value := DeltaDS.FieldByName(FieldName).NewValue
                else
                  Params[I].Value := DeltaDS.FieldByName(FieldName).OldValue;
            end;
          ExecProc;
          Applied:= true;
    end;
  end;


The problem is that since I set the Applied to true, then no error reconciliation takes place at all. On the other hand, if I do not set it to true, the updates are applied a second time by the ApplyUpdates method. I cannot have the second case as this result in the construction of an SQL statement directly on the table where the record is set and the users do not have the privileges to do insert or select... they can only execute stored procedures...
How would you suggest I implement the OnErrorReconciliation event?

Cheers
________
Uggs
Last edited by david_labbe on Thu 10 Mar 2011 10:09, edited 1 time in total.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 03 May 2006 14:41

This question mostly concerns Midas, but not MyDAC. If you find any other bug in MyDAC, please send its description to us.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 04 May 2006 06:40

Antaeus wrote:This question mostly concerns Midas, but not MyDAC. If you find any other bug in MyDAC, please send its description to us.
I am not suggesting it is a bug. I was just wondering if you had an idea of how to resolve that matter.
________
GIRLFRIENDS PICS
Last edited by david_labbe on Fri 18 Feb 2011 15:34, edited 1 time in total.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 04 May 2006 08:43

Unfortunately we are not supposed to solve any problems and questions, except the ones related to Core Lab products. Suggesting solutions exceeds tasks of Core Lab support team.

david_labbe
Posts: 39
Joined: Wed 01 Mar 2006 15:27

Post by david_labbe » Thu 04 May 2006 09:25

Antaeus wrote:Unfortunately we are not supposed to solve any problems and questions, except the ones related to Core Lab products. Suggesting solutions exceeds tasks of Core Lab support team.
I thought this was a forum where people could talk about not only bugs but also general problems and solutions...

If the CoreLab products had better help and documentation files, I would not be asking the questions...

Can we expect better help files and documentation???
________
Nevada Marijuana Dispensaries

Post Reply