Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working with four old VB6 applications connected to MS Access using DAO which we are trying to gradually replace. We have a lot of issues with locks/deadlocks in one very large configuration table with like 100 columns and just one row. Lots of headaches with that poor design.

We decided to remove the most edited columns from that table and create two new tables based on the columns's functionality, with them having Name/Value pairs
We also wanted to try a separate C# data layer COM application or dll to actually handle access to the tables and eventually more data. All four VB6 applications will need to talk to the old table and the new tables.

We also wanted to access the tables, particularly the large config one, as little as possible unless a change was detected. We would keep the values in memory ie with a data table, etc, when possible.

My question is....should I use COM events to trigger things to tell the 4 programs a database column value has changed? How do I keep things in 'synch'? Should I should just read from the database directly at all times? We want to minimize running selects against the Access files and coordinate edits/updates. What course of action should I use?
Any help appreciated.
Posted
Updated 27-Mar-14 2:07am
v3
Comments
Sergey Alexandrovich Kryukov 26-Mar-14 17:08pm    
Are you saying VB6 code, some of it, should stay? It might defeat the purpose of all your other changes. Too many people were fed by illusions that they could get some benefits of re-using VB6 code, but I never heard of a single success story; in all cases it was more expensive than completely new development, and the results were unreliable, if any. And, if you could move to pure .NET, COM would be totally pointless, only as a possibility to contaminate the system.
—SA
gggustafson 28-Mar-14 1:14am    
How do you plan to detect that a database value has changed?
CHill60 30-Mar-14 11:41am    
Some thoughts...
(1) Why keep the old table at all? Replace entirely with Name/value style table.
(2) Data Access layer is a good idea ... so why would you "tell the 4 programs" a database column value has changed? Keep the data in the data layer and have the VB programs query that each time. You can then choose when that component refreshes it's data in memory.
(3) How often can this data change? Are the programs running permanently? These will both factor into whether or not or how to keep things "sync'd"
(4) With a better table design you are probably better off just querying for the data each time it is required - but that very much depends on the nature of that data.
(5) Any option to replace the Access database with another RDMS? Is it held on a server, are all these programs running on the same PC/Server. Number of Users?
(6) If there is complex processing in the VB6 programs (e.g. calculations) an alternative option would be to convert as must as possible to .NET and move the VB6 calcs to a COM dll to minimise the re-testing required up front.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900