I have been receiving a "Key column information is insufficient or incorrect. Too many rows were affected by update" error. I get this error on the <Recordset>.UpdateBatch method in VB when it is executed for a master table associated with another tables (via primary keys/foreign keys) in a SQL Server 2000 Database.
The relationship between the tables is a one-to-many relationship in most cases. The relationship is generally set up as the following on the relationship properties between the tables in SQL Server 2000:
* Enforce relationship for replication
* Enforce relationship for INSERTs and UPDATEs
Since I am using the <Recordset>.UpdateBatch method to update the master table, I am not able to see the SQL of the method to fully determine why the "Key column..." error occurs. This method is a predefined method in Microsoft Visual Basic 6.
But, I have viewed primary keys on records in the <Recordset> using the Print command in the Immediate window (i.e. Print <Recordset>.Fields("<FieldName>"
.Value). There are actual values for the keys and they seem to be correct.
What is a good work around in Visual Basic 6 for this problem? If you have any ideas, please let me know.
Thanks.
The relationship between the tables is a one-to-many relationship in most cases. The relationship is generally set up as the following on the relationship properties between the tables in SQL Server 2000:
* Enforce relationship for replication
* Enforce relationship for INSERTs and UPDATEs
Since I am using the <Recordset>.UpdateBatch method to update the master table, I am not able to see the SQL of the method to fully determine why the "Key column..." error occurs. This method is a predefined method in Microsoft Visual Basic 6.
But, I have viewed primary keys on records in the <Recordset> using the Print command in the Immediate window (i.e. Print <Recordset>.Fields("<FieldName>"
What is a good work around in Visual Basic 6 for this problem? If you have any ideas, please let me know.
Thanks.