Updating fields in recordset

ADO-Nick

New member
Local time
Today, 08:07
Joined
Oct 2, 2003
Messages
8
The following is an extract form my programming, using ADO, to store a value - arValues(i) - into a field - Fields(1), having first created a new record in the recordset.

objRS.AddNew
objRS.Fields("Data_ID").Value = intIndex
objRS.Fields(1).Value = arValues(i)
objRS.Update

The first & second lines work without errors. The third line produces the following error:

Error no is... -2147217887
Description... Field cannot be updated.
Source... Microsoft JET Database Engine

The fourth line produces the following error (presumably this could be a cascading error):

Error no is... -2147217887
Description... Update or CancelUpdate without AddNew or Edit.
Source... Microsoft JET Database Engine

All this takes place having added a column to the database using ADOX, which occurs successfully & without errors. However, when I establish the name of the field in the recordset - objRS - which corresponds to the new column, I get the following:

Name of objRS col 1 = Expr1001

perhaps this is significant?

What have I done wrong??

All help gratefully received. Thanks.

ADO-Nick
 
Looks like your name didn't stick.

Exprnnnn is Access's way of saying it applied a default name to something. So the step where you added the new field must not have worked quite as successfully as you thought.

As to why you got the first error you mentioned, we would need to know the attributes of the field to be able to help more.

I more or less agree that the second error is a derivative of the failure associated with the first error.
 
Attached are attributes of the column.
 

Attachments

Users who are viewing this thread

Back
Top Bottom