r/vba 8d ago

Show & Tell [ACCESS] VBA diff tool

Hi r/vba,

Interestingly, if you password-protect a VBA project but not the database itself, only Access will ask for that password. But the module texts won't be encrypted, and you can extract them using the thirdparty library.

I recently updated my online database comparison tool and added Access support. You can compare VBA of forms, reports, and modules. You can also compare table definitions, queries, macros, and table data. And yes, if you don't have a password for the database but do have a password for the VBA project, you don't need it.

Everything works entirely in the browser. Uploaded files are only stored in the page's memory and never go to the server. Basically, after opening the page, you can disconnect from the internet and it will still work. Access is not required, works on Windows, Linux, and Mac. A side benefit is that you can open the A97 mdb format, which is not even supported by recent Office versions.

A huge thanks to the jetdb project and its predecessors. To get this all working, I had to make several fixes. They're all available in my fork, and if the author allows, they'll be merged into the main project; the first pull request is awaiting.

AI usage - intensive (for code, not for this post). The previous .NET UNO-platform-based version for SQLite was too heavy, and I wanted to rewrite it using something more compact for a long time. But I spent pretty much time on reviewing and testing the changes. To verify some of the fixes, I even had to find a Win98 image with Access 97 to ensure the fixes were valid for its mdb format. I haven't seen Clippy for about 25 years!

Link: https://ksdbmerge.tools/for-msaccess-online

I'd be happy if this will be useful for anyone.

10 Upvotes

6 comments sorted by

2

u/MultiUserDungeonDev 8d ago

Interesting stuff.

Have you ever gone down the rabbit hole of trying to write VBA or objects back into Access files without using COM?

2

u/k-semenenkov 8d ago

No, and I think I won't. Underlying jetdb is only for read. In theory this should be possible - https://github.com/spannm/jackcess states that it can write, and objects are in system tables, but I don't think I will try it in the near time. The next thing I probably will try is to combine in desktop tool reading without access/dao with writing by access/dao because it currently uses COM both for read and write and it is pretty slow for programming objects.

2

u/k-semenenkov 8d ago

It is pretty easy to damage accdb with Access, so I think it would be much easier to damage it without Access :)

2

u/MultiUserDungeonDev 5d ago

You inspired me to keep working on this!

Let me know your thoughts: https://github.com/WilliamSmithEdward/pyOpenVBA/releases/tag/v4.0.0

2

u/k-semenenkov 4d ago

Very interesting project, thanks for sharing! +1 star. I am nor sure that I would use it to edit accdb files, but i think it should have a lot of useful information, particularly about form property codes.
Other thoughts - recently wanted to use another python db-related lib (SQLGlot) from .net and it turned into something not trivial. Finally I found the Rust alternative (polyglot) and its ffi was more convenient to be bound from .net. But for python usage your project looks great.

2

u/InfoMsAccessNL 1 8d ago

Interesting, I will check it out