Using C#, I had a problem with a database I use directly in Access. I used an OleDbDataAdapter, OleDbCommandBuilder and DataTable. The update command was generated by the OleDbCommandBuilder. Using this update command would generate a syntax error in the UPDATE statement.
As a test, I created a real simple Access database with 2 fields: Name and Job. Using the exact code from what I described above (except for obvious changes), the update command worked fine with this. Then I created another database with 5 fields: Name, Job, Id, Year and Country but this got the same syntax error as above. I commented out different field assignments until I found that it is the "Year" field that will causes the error. The Id and Year fields are both integers and the others are text. It will update the Id field and text fields, but if I include the Year field it will generate the error. It makes no sense!
Can any one make sense of this and help please??? Is there a way to see the SQL update expression that the OleDbCommandBuilder is using?
Thanks!
Valhalla