Sorry for the double posting. First time posting in google. Didn't
realise it takes 3 to 9 hours to appear. Please bear with me, I am new
to progamming, trying a DIY.
No, I did not use an autoinc. I have created a mysql database as
below
Master table: field A (not null) primary key, B, C, D, E.
Detail table 1: field A (not null), F, G, H, I.
Detail table 2: field A (not null), J, K, L, M.
..
#Field A are alphanumeric character ID inserted at the client level.
I wished to create a client that can update my database through a
network. As I had only purchased Delphi 2005 professional I could not
use datasnap server (Datasnap data module not included) but I could
get around using web based SOAP connection.
From the creation of the SOAP server, SOAP data module, till SOAP
Client. I have followed the tutorial and nested the DETAIL dataset
into the MASTER dataset and it worked perfectly (!after several bumpy
detour). I have 4 DBGrids which displayed the corresponding tables,
with a master detail relationship taking A as the link. I did not
have any problem at inserting new records in all 4 dbgrid. It updated
well. My problem begins when I tried to remove a record. I was unable
to remove records even at the DETAIL datagrid. When it comes to Field
A, after emptying the column, at update I get 'Field Value Required'
error. I notice the only way I can get around this error is to allow
NULL in the MySQL database Field A. If I could not empty my DETAIL
dataset, I suppose it would be harder for me to empty my MASTER
dataset. This would also mean in removing the primary key, which is
not an intelligent thing to do.
I suppose this is a very fundamental feature. There should surely be
a workaround to this.
As you have pointed out QC5557 the following were one of the excerpt.
<<
By default, MIDAS attempts to ensure the NOT NULL constraint is
enforce at the client. Sounds reasonable to me. As you rightly say,
you can overide this behaviour if you want to and not enforce this at
the client by setting the TField.Required flag to false on the
DSP.DataSet. The choice is yours. You can then test this field in the
DSP.BeforeUpdateRecord or DSP.OnUpdateData event and provide a value
in the DeltaDS if you want to prior to updating the DB. This provided
TField value can optionally be passed back to the CDS using the
DSP.Option poPropogateChanges.
Quote
>
I suppose DSP here meant the datasetprovider which in my case is
located at the server application. 'TField.Required flag' I have
expanded all properties in the object properties for my
datasetprovider and could not find any flag for specific datafield.
Did I miss anything. The site that I could locate inregards for option
to field properties is at the cds at the client side. I don't suppose
this was what Dave meant.
I have downloaded QC5603, sorry I have ended up more confused. By the
way it also ended with similar error messages when I tried to remove
the ID's.
Thanks in advance.
{smallsort}