Home > programming > Visual Basic 6 on Windows 7: DBGrid32.ocx Issues

Visual Basic 6 on Windows 7: DBGrid32.ocx Issues

January 26th, 2012 Leave a comment

    Unfortunately, I’m one of those poor programmers who is forced to maintain some pretty old applications written in Visual Basic 6.  Thus, it was imperative to get the IDE working on Windows 7. When I looked into this issue two years ago, I found an informative post covering the basics over at FortyPoundHead. The installation guide works pretty well except you don’t need to turn off UAC first. So here’s a short summary on how to install VB6 on Windows 7.

    1. Create an empty file in your Windows directory called MSJAVA.DLL. This is to skip the install of this very old MS Java thingy which even requires a reboot.
    2. Run setup.exe as administrator and install the needed components
    3. Install the Service Pack 6
    4. Install the Visual Basic 6.0 Service Pack 6 Cumulative Update

    Step 4 is the culprit that breaks your DBGrid. It will cause your DBGrid controls to lose any information like data sources, layout settings, and so on. So before you proceed with step 4, make a backup of %windir%\system32\dbgrid32.ocx. After installing the SP6 Cumulative Update, replace the newly installed DBGrid32.ocx with the backup you’ve created earlier. Now register the OCX via regsvr32. Everything works fine again.

    Alright, this is a dirty hack. It’s definitely better to simply get rid of this control or even better yet – upgrade to a newer Version of Visual Basic. If you’re like me and you can’t migrate to a newer version though, it might help you get around this issue until you’ve replaced all the controls. Good luck!

    1. jo
      May 11th, 2013 at 07:11 | #1

      thanks a lot it works!!

    2. rahma
      August 21st, 2013 at 04:19 | #2

      can i get dbgrid32.ocx and dbgrid32.reg for vb6 on windows 7 with 32 bit operating system, please send to rahmawatiekafitriani@yahoo.co.id
      tq

    3. Ralph
      January 27th, 2014 at 18:00 | #3

      Super.  Worked like a charm.  Thanks

    4. David
      January 27th, 2016 at 23:25 | #4

      What was the version / date/time on the “Good” DBGrid32.ocx?

    5. JC
      January 28th, 2016 at 10:22 | #5

      We’re still using version 5.01.8104 from 1998-06-23 which looks like it might be the file originally shipped with VB6 back in 1998. Not much longer though, we’re in the process of migrating to Java.

    6. yuvika
      April 25th, 2016 at 10:36 | #6

      Great it worked for me also

    1. No trackbacks yet.