// blog
We Moved a Visual Basic Program to the Web. Its Code Had Six Bugs.
When we moved an open-source Visual Basic inventory program to the web, reading its code turned up six bugs: a delete that matched every record, a stock count that could go blank, a trigger calling a procedure that didn’t exist, typed text going straight into SQL, plain-text passwords, and a loan returned before it went out. Each is fixed in the web version. Old business programs often hide problems like these, and moving a program is the moment they get found.

Old Visual Basic programs run a lot of small businesses. They usually work, and nobody has read their code in years. We moved one to the web, and read every line first.
The program
It’s an open-source Visual Basic program (VB.NET, Windows Forms and MySQL, MIT License) that lends out equipment: who has what, when it’s due back, what’s in repair. We rebuilt it as a web app for a made-up tool room, Tamsin Precision.
The six bugs
- One delete removed every record. A delete took a value with the same name as the column, so the database compared each column with itself, and every row matched.
- The stock count could go blank. A database trigger used a name that hid the real column, so the count could go blank after a loan was deleted.
- Adding an item failed. A trigger called a procedure that wasn’t in the database.
- An apostrophe broke a loan. Typed text went straight into the database command. “O’Brien” was enough to break it, and worse text could do harm.
- Passwords in plain text. Anyone who could open the database could read them all.
- Returned before it went out. Nothing checked the dates, and a sample loan came back before it left.
None of these show up in a demo of the old program. They show up on a bad day.
Why old programs hide bugs like these
A program that’s been running for years has been tested by use, not by anyone reading it. Its rules live in button code and in the database, and the person who wrote them may be gone.
Moving it to the web is the moment someone reads all of it. Each rule gets written down in one sentence, checked with the people who use it, and built once on the server, with a test.
What changed
In the web version, on the shelf is always worked out from the loans and repairs, so it can’t drift. Something returned broken goes to repair, not back on the shelf. Staff sign in with their company account. And reports download as real Excel files, without Office on the PC.
How we built it · Move your VB6 program · Move your WinForms app
































































































































