Updating tables in access
The SELECT query always returns data when called on a command object using Execute Reader(). (Note that I've used this query both with and without the enclosing brackets around the field names.) Because of this failure, I attempted to use a Data Adapter instead. Update Command = update Command; Data Table dat Users = new Data Table(); retrieve Command. Product ID is the primary key and is autonumbered by Access.The second table, Aliases, is made up of three fields, Alias ID, Product ID and Product Alias.
There are two fields in this table, Product ID and Product Name.
The code, minus exception-handling bits, looks like: Ole Db Data Adapter data Adapter = new Ole Db Data Adapter(); Data Set user Data = new Data Set(string.
Remove(param User ID); // modify Data Table data user Data.
The Alias table is used so that if a product has more than one name, the names will be recognized as one product by having a common Product ID.
I have referential integrity set up between the tables with cascading updates and deletions.
Don’t do massive update queries using Access If you ever need to update a lot of records at once, say, increase pricing on all items by 10%, you’re much better off doing the update via a pass-thru query or on the server directly. Limiting data to just a fraction of records at any given time.