Board index » delphi » joined table update with ado in access

joined table update with ado in access

hi
D6 sp2  Ms access,
it's a c/s ,server-side is ado + access, and client side is TClientDataSet +
dcom.
my question is  :
   In server ,adodataset.commandtext is a joined sql script---
  " select emp.*, dep.departmentname,  edu.educationname ,
    rig.rightname
    from employeedb emp, departmentdb dep, educationdb edu,
    rightdb rig
    where (emp.departmentid = dep.departmentid) and
    (emp.educationid=edu.educationid) and  (emp.rightid=rig.rightid)  "
   and the DataSetProvider's resolveTodataSet is true.

  then execute Clientdataset.open, i can get the record of querying, but
  if i execute Clientdataset.delete and execute
Clientdataset.applyupdate(0),
  then server-side raise a exception of "Unable to find record. no key
specified"

so who can prompt me a  solution.
thanks.

 

Re:joined table update with ado in access


This error often occurs when the key fields are not available in the select
part of the SQL or when a primary key is not defined for the table. I would
try and build the SQL and modify the rows without using client datasets
until you receive no errors, then try with CDS.

(There are some related topics "Update Criteria" & "Unique Table" that you
may need later.)

--
Michael Collier
--
Courses http://delphi.about.com/library/weekly/aa010101a.htm
Better ADO Components http://web.orbitel.bg/vassil/
Experiment With ADO www.adoanywhere.com
Fast Data Access www.oledbdirect.com
--

Quote
"Alex" <zhang-a...@163.com> wrote in message news:3cfca149_2@dnews...
> hi
> D6 sp2  Ms access,
> it's a c/s ,server-side is ado + access, and client side is TClientDataSet
+
> dcom.
> my question is  :
>    In server ,adodataset.commandtext is a joined sql script---
>   " select emp.*, dep.departmentname,  edu.educationname ,
>     rig.rightname
>     from employeedb emp, departmentdb dep, educationdb edu,
>     rightdb rig
>     where (emp.departmentid = dep.departmentid) and
>     (emp.educationid=edu.educationid) and  (emp.rightid=rig.rightid)  "
>    and the DataSetProvider's resolveTodataSet is true.

>   then execute Clientdataset.open, i can get the record of querying, but
>   if i execute Clientdataset.delete and execute
> Clientdataset.applyupdate(0),
>   then server-side raise a exception of "Unable to find record. no key
> specified"

> so who can prompt me a  solution.
> thanks.

Other Threads