MoveNext : "Key column information is insufficient or incorrect" error

Hi,

First of all, thanks for clicking and simply reading this post.

Have a form in vb.net that contains the following:-
- 1 classic Ado control(called ADODC14) bound to a TABLE(called Tbl_Variations)
- several Textboxes bound to different FIELDS within the TABLE  

The TABLE is in Access 2000 and contains :-
- zero - several records in the TABLE. (Depends upon situation)
- contains NO PRIMARY KEY (but each record has a guarenteed VARIATION NUMBER that is generated at runtime before a new record is added to the table.
 - Boolean (Yes/No) DataTypes fields bound to Textboxes. This simply populates the textboxes with True/False/"" depending if the field value is Ticked/Not Ticked/DBNull
- Text DataTypes fields bound to Textboxes

Want to move between RECORDS in the TABLE if several records exist.

Using Adodc14.Recordset.MoveNext , .MovePrevious to tranverse between records

This error happens sometimes upon MoveNext, MovePrevious, but fails upon transitions between CERTAIN records.

For Example:

TABLE contains several variation number (3,5,7,9,12,17)

MovePrevious works fine EVERYTIME going from 17 to 12
MovePrevious fails EVERYTIME going from 12 to 9 giving the error message
"Key column information is insufficient or incorrect. Too many rows were affected by update."

Anybody know why this is?? You thoughts would be most appreciated.

Stuart

StuartKAsked:
Who is Participating?
 
RonaldBiemansConnect With a Mentor Commented:
The reason you get this error is because you don't have a primary key, add a primary key to your table
0
 
RonaldBiemansCommented:
Hi StuartK,

Is there a special reason you are using the "old" adodc instead of the new ado.net.

0
 
StuartKAuthor Commented:
Just found that out myself. Infact I came back to Delete the post before anybody answered. Guess I was too late!!

Thanks for letting us know Ronald.

It's Typical, I've been fighting with this for a couple of hours, and as I spend time to explain on EE, within 10minutes I've sorted myself.

Stu
0
 
StuartKAuthor Commented:
Hi Ronald,

Old classic Ado control.

We have 100+ forms that were converted over from VB6 and it did so by creating the classic ADO control in vb.net.

We have kept it that way until we can buy enough time to convert over to ADO.NET. That is our intention. A big job, and it'll involve changing the architecture of how the code works.

So in short it's a legacy of our old system at the moment.

Stuart
0
All Courses

From novice to tech pro — start learning today.