Batch update linked tables
-
Hello fellow developers! I have a problem. I am trying to optimize some database transfer code and I am stuck. Here is a brief introduction to what I have today: The database is a Jet 3.5 database with a lot of tables. The tables I want to update are linked together like this (PK): Shelf(ShelfNr)-->Inventory(ShelfNr,ArticleNr)<--Article(ArticleNr). ArticleNr is a unique number but ShelfNr is based on an auto-counter field. The problem with this that I cant use batch updates (through an ODBCDirect workspace) and at the same time use code like this: ' Pseudo VB-code rsShelfTo.AddNew ' copy all fields except key rsShelfTo.Fields = rsShelFrom.Fields rsShelfTo.Update rsShelfTo.Bookmark = rsShelfTo.LastModified ' CurrentShelf always gets the value 0 with this code, why? CurrentShelf = rsShelfTo.Fields("ShelfNr") I would like to include all updates in a transaction some my question is can I switch between using dbUseClientBatchCursor and dbUseDefaultCursor and still keep the transaction alive? Any ideas? -- Mattias Wahlberg IDNet