I’m experiencing some problem when I compile some legacy apps on VB6 since I got a new development machine in windows 7. (my old one was on Windows XP.)
If I compile the project on my XP machine, everything is fine.
If I compile the same project on my Windows 7 machine, it still run fine one it, but if I try to run it on a XP machine, I got this error.
Error Number : 5
Description : Invalid procedure call or argument
Thanks to my error handler, I know that the line that throw this error is :
Dim objConn As ADODB.Connection
--> Set objConn = New ADODB.Connection
I compared the references on both machines and the Project - References are the same : (Microsoft ActiveX Data Objects 2.7 Library)
What could cause this error?
This is a known Microsoft issue, but I don’t think it was a bug; I believe compatibility was broken for security reasons. The problem could have existed on a non-SP1 builds if you had a certain hotfix installed. There are a couple of options referenced in the Microsoft KB. Here is another article providing an update.
We ran into this problem and we decided to deploy the Backwards Compatibility patch on all developer machines and replace all legacy ADO references with the Backwards Compatibility reference. This has worked well for us.