Re: Modifying an access-table using clientdatasets



It works!

Tip: Never name a field 'UPDATE'.


"Koen" <koen@xxxxxxxx> wrote in message
news:48045e06$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I found it has something to do with the ADOQuery component.

I added the fields here using the fieldeditor and for the indexfield I
added the pfInKey option.

When applying updates I now get the following exception:

Project xxxxx.exe raised exception class EOleException with message
'Syntax error in update statement'.

Guess I am getting closer..

Anybody any ideas?

Regards,
Koen

"Koen" <koen@xxxxxxxx> wrote in message
news:48045c20$1@xxxxxxxxxxxxxxxxxxxxxxxxx
The access table has a single unique primary (integer) key. (access 2000)
In my clientdataset I set the IndexFieldNames property to the name of the
indexfield.

When applying updates I get the following exception;

Project xxxxxx.exe raised exception class EDatabaseError with message
'Unable to find record. No key specified'.

In the ADOQuery component I have set the SQL property
select * from terminals

The DataSet property of the provider component is set to this query.
I changed the UpdateMode to upWhereKeyOnly.

Then the ClientDataset's property ProviderName is set to this provider
component.
I added the fields using the fieldeditor.
The IndexFieldNames property is assigned the name of the indexfield.

This works fine to browse the data (unidirectional) but when I apply the
updates I get the exception mentioned above.

I guess I am overlooking something?

Regards,
Koen




"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:ci6804hq69rdc25esmt6k8b2ugu6vsciu7@xxxxxxxxxx
I am editing a table in an access-database using ADO. To modify the
table I
use a TADOQuery (SQL=select * from mytable), a TDatasetProvider and a
TClientDataset component.
Browsing tru the data using a grid works fine but when I start editing
things start to go wrong.
1) When I 'refresh' (using the navigator) I get an exception saying I
need
to ApplyUpdates first..
2) When I use a 'detail-dialog' to modify a record and call ApplyUpdates
when the dialog is closed I get the exception '....unable to find
record. No
key specified'.

You will need to have a table with a unique key to be able to edit it
with a
clientside cursor
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx






.