Jan Doggen
2008-01-29 12:59:32 UTC
This TClientDataSet 'Post' fails
with "Field 'Task' must have a value':
with dmViseTools.cdsUserAccess do begin
Insert;
{ These are the four fields in table UserAccess, they need updating: }
FieldByName('UA_User_ID').AsInteger := UserID;
FieldByName('UA_Task_ID').AsInteger := TaskID;
FieldByName('UA_Level_ID').AsInteger := LevelID;
FieldByName('UA_Lang_ID').AsInteger := LangID
Post;
end; { with dmViseTools.cdsUserAccess }
This is the underlying TSQLQuery:
SELECT
A.UA_User_ID,A.UA_Task_ID,A.UA_Level_ID,A.UA_Lang_ID,T.Task_Descrip as
Task,L.Level_Descrip as Level,Language=
CASE T.Task_HasLanguages
WHEN 1 THEN G.Lang_Name
ELSE 'n/a'
END
FROM UserAccess A, UserTasks T, UserLevels L, Languages G
where A.UA_User_ID=:UID
and A.UA_Task_ID=T.Task_ID
and A.UA_Level_ID=L.Level_ID
and A.UA_Lang_ID=G.Lang_ID
Table UserAccess does not have a primary key or indices, the values I
insert are not duplicates.
I have been messing with the provider UpdateMode and the ProviderFlags
of the query FieldDefs, but I can't get it to work.
Who can push me in the right direction?
Thanks
Jan
with "Field 'Task' must have a value':
with dmViseTools.cdsUserAccess do begin
Insert;
{ These are the four fields in table UserAccess, they need updating: }
FieldByName('UA_User_ID').AsInteger := UserID;
FieldByName('UA_Task_ID').AsInteger := TaskID;
FieldByName('UA_Level_ID').AsInteger := LevelID;
FieldByName('UA_Lang_ID').AsInteger := LangID
Post;
end; { with dmViseTools.cdsUserAccess }
This is the underlying TSQLQuery:
SELECT
A.UA_User_ID,A.UA_Task_ID,A.UA_Level_ID,A.UA_Lang_ID,T.Task_Descrip as
Task,L.Level_Descrip as Level,Language=
CASE T.Task_HasLanguages
WHEN 1 THEN G.Lang_Name
ELSE 'n/a'
END
FROM UserAccess A, UserTasks T, UserLevels L, Languages G
where A.UA_User_ID=:UID
and A.UA_Task_ID=T.Task_ID
and A.UA_Level_ID=L.Level_ID
and A.UA_Lang_ID=G.Lang_ID
Table UserAccess does not have a primary key or indices, the values I
insert are not duplicates.
I have been messing with the provider UpdateMode and the ProviderFlags
of the query FieldDefs, but I can't get it to work.
Who can push me in the right direction?
Thanks
Jan