ADODB + VB6 = 100 Database Connection Limit

Here’s an obscure one for 2019 that calls back to the 1990’s.

Did you know that database connections in VB6 had an obscure hard-limit of 100 simultaneous database connections through ADODB that literally could not be bypassed and was referenced but effectively undocumented?

Did you also know that other than ADODB there was virtually no way to access SQL Server from VB6 without rolling your own solution?

I used to maintain a website that ran on this combination just 4 years ago.

At the time when I was told by the IT Manager of the company and I didn’t believe him. I searched high and low all over the internet and unfortunately for me, eventually confirmed that what he had said was true. You could set a connection limit higher than 100 in your connection strings for ADODB but they were ignored. Just completely and utterly ignored.

This is a PSA to anyone finding themselves inheriting such a legacy application and wanting to scale since I had so much trouble confirming it myself. Database pooling wasn’t really a thing – this application used a singleton model for opening and closing database connections during a web request and the company that had this software would go through peaks of traffic where you could have hundreds of users accessing the software at once resulting in way too many open database connections.

To get around this the IT Manager had gone so far as to set up multiple physical servers and on each of those, multiple virtual machines, all with the software installed and using a firewall infront of it all to specifically limit each instance of the application to 100 users.

His method worked – but he also ruled out any possibility of us ever upgrading the software to get past this limitation (something I did not long after he was let go) – as it had been attempted in the past and failed.

Now they run on a single instance of the software, negating the massive mess of infrastructure he’d required to tame the beast.

  • October 29, 2019