Field cannot be updated 
Author Message
 Field cannot be updated

To start I wrote some code and used the Wizard for the dialog (Vis C++
v 6.0). The result was add,edit and delete records in an access table
with no trouble.

I then wanted the ultimate - ie a listing of all the people whose
surname started with 'x' or maybe 'S' - now that works really fine and
the selection from the resulting list also works well.

The unfortunate thing is that the input of new names has come unstuck.
Instead of the usual problem free input, I now get the 'Field cannot
be updated' (how do I make it tell me which field) - I have not
changed any fields and the table contains all TEXT fields apart from
the Access generated long ID number and the birthdate of the person.
But as I say - nothing has been changed in those fields - can you help
- please.



Mon, 29 Jul 2002 03:00:00 GMT  
 Field cannot be updated
What database technology do you use (ADO, OLEDB, DAO, ODBC?). Your problem
is most certainly the autonumber field, Jet (which is the actual db system,
Access is just Microsofts idea of an UI for the db engine) does not like it
when a db client tries to update an autonumber field, even when it's with
the fields' current value. If you use ADO/OLEDB you must use an accessor
without the autonumber field. I'm not sure for DAO or ODBC.

good luck
S{*filter*}


Quote:
> To start I wrote some code and used the Wizard for the dialog (Vis C++
> v 6.0). The result was add,edit and delete records in an access table
> with no trouble.

> I then wanted the ultimate - ie a listing of all the people whose
> surname started with 'x' or maybe 'S' - now that works really fine and
> the selection from the resulting list also works well.

> The unfortunate thing is that the input of new names has come unstuck.
> Instead of the usual problem free input, I now get the 'Field cannot
> be updated' (how do I make it tell me which field) - I have not
> changed any fields and the table contains all TEXT fields apart from
> the Access generated long ID number and the birthdate of the person.
> But as I say - nothing has been changed in those fields - can you help
> - please.



Mon, 29 Jul 2002 03:00:00 GMT  
 Field cannot be updated
As you can imagine - when in trouble you start diggin deep. I am using
Dao and have just built another program with the same fields and the
same table - that works well - now I shall have to go though the code
to see what difference there is. I shall let you know when I see the
trouble.

To the people only speaking english, I apologise:

Glad ved at see at der nu or da kommer email fra Danmark. Jeg forlod
Danmark i 45 efter Krigen some engelsk soldat. Arbejdede i England og
udrejste i 82 - som di ser - Jeg er nu i Perth i Australien.
Tak for hjaelpen.

Quote:

>What database technology do you use (ADO, OLEDB, DAO, ODBC?). Your problem
>is most certainly the autonumber field, Jet (which is the actual db system,
>Access is just Microsofts idea of an UI for the db engine) does not like it
>when a db client tries to update an autonumber field, even when it's with
>the fields' current value. If you use ADO/OLEDB you must use an accessor
>without the autonumber field. I'm not sure for DAO or ODBC.

>good luck
>S{*filter*}



>> To start I wrote some code and used the Wizard for the dialog (Vis C++
>> v 6.0). The result was add,edit and delete records in an access table
>> with no trouble.

>> I then wanted the ultimate - ie a listing of all the people whose
>> surname started with 'x' or maybe 'S' - now that works really fine and
>> the selection from the resulting list also works well.

>> The unfortunate thing is that the input of new names has come unstuck.
>> Instead of the usual problem free input, I now get the 'Field cannot
>> be updated' (how do I make it tell me which field) - I have not
>> changed any fields and the table contains all TEXT fields apart from
>> the Access generated long ID number and the birthdate of the person.
>> But as I say - nothing has been changed in those fields - can you help
>> - please.



Tue, 30 Jul 2002 03:00:00 GMT  
 Field cannot be updated

Quote:

>What database technology do you use (ADO, OLEDB, DAO, ODBC?). Your problem
>is most certainly the autonumber field, Jet (which is the actual db system,
>Access is just Microsofts idea of an UI for the db engine) does not like it
>when a db client tries to update an autonumber field, even when it's with
>the fields' current value. If you use ADO/OLEDB you must use an accessor
>without the autonumber field. I'm not sure for DAO or ODBC.

>good luck
>S{*filter*}

None of my books with mention of Dao wrote about accessor's - the only
place I saw that was in Ivor Hortons 'Introduction to Visual C++' and
that was ODBC. I managed to show the ID using the edit as a control,
converting the number to a string and use SetWindowText(string). Maybe
there is a more educated way to do that but it works and for now that
counts. Thanks very much.
Quote:



>> To start I wrote some code and used the Wizard for the dialog (Vis C++
>> v 6.0). The result was add,edit and delete records in an access table
>> with no trouble.

>> I then wanted the ultimate - ie a listing of all the people whose
>> surname started with 'x' or maybe 'S' - now that works really fine and
>> the selection from the resulting list also works well.

>> The unfortunate thing is that the input of new names has come unstuck.
>> Instead of the usual problem free input, I now get the 'Field cannot
>> be updated' (how do I make it tell me which field) - I have not
>> changed any fields and the table contains all TEXT fields apart from
>> the Access generated long ID number and the birthdate of the person.
>> But as I say - nothing has been changed in those fields - can you help
>> - please.



Thu, 01 Aug 2002 03:00:00 GMT  
 Field cannot be updated
Hej Borge,

I'm not too familiar with the internals of DAO, but you're right there's no
accessors there. However, there is still binding of fields in your C++ code
to the fields in the database. What I suggested was this: you do a read from
a database, display the result, change nothing and then do an update to the
db. Although you haven't changed any fields, you're still trying to set the
value of the autonumber field (at least from Jet's point of view), and this
is not allowed. But, reading your original post a second time you do not
mention anything about updating, so now I'm a little confused...

Perhaps a little code can clarify your problem for me?

Skaal og vaer hilset downunder
S{*filter*}.


Quote:

> >What database technology do you use (ADO, OLEDB, DAO, ODBC?). Your
problem
> >is most certainly the autonumber field, Jet (which is the actual db
system,
> >Access is just Microsofts idea of an UI for the db engine) does not like
it
> >when a db client tries to update an autonumber field, even when it's with
> >the fields' current value. If you use ADO/OLEDB you must use an accessor
> >without the autonumber field. I'm not sure for DAO or ODBC.

> >good luck
> >S{*filter*}
> None of my books with mention of Dao wrote about accessor's - the only
> place I saw that was in Ivor Hortons 'Introduction to visual C++' and
> that was ODBC. I managed to show the ID using the edit as a control,
> converting the number to a string and use SetWindowText(string). Maybe
> there is a more educated way to do that but it works and for now that
> counts. Thanks very much.



> >> To start I wrote some code and used the Wizard for the dialog (Vis C++
> >> v 6.0). The result was add,edit and delete records in an access table
> >> with no trouble.

> >> I then wanted the ultimate - ie a listing of all the people whose
> >> surname started with 'x' or maybe 'S' - now that works really fine and
> >> the selection from the resulting list also works well.

> >> The unfortunate thing is that the input of new names has come unstuck.
> >> Instead of the usual problem free input, I now get the 'Field cannot
> >> be updated' (how do I make it tell me which field) - I have not
> >> changed any fields and the table contains all TEXT fields apart from
> >> the Access generated long ID number and the birthdate of the person.
> >> But as I say - nothing has been changed in those fields - can you help
> >> - please.



Fri, 02 Aug 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. What field am I getting into?

2. cannot read long varchar field values from ADO Recordsets

3. Cannot Add Currency Field to Database

4. Cannot open a CDAORecordset without correct field

5. cannot set input focus in CEdit field

6. Cannot access updated datagrid value

7. CRecordset cannot be updated

8. Cannot update , table locked problem

9. Cannot Convert CTime to time when update?

10. UPDATE: DLL cannot load its own string resources

11. OLE DB Cannot update record

12. MS Develop.Studio & Win95, cannot update resources

 

 
Powered by phpBB® Forum Software