Issue with ADODB connection on Window 7 using VBScript – Resolved

0
165

Recent days, I have seen enterprises are migrating their operating systems (OS) from XP to Windows 7 as Microsoft announced the end of support for Windows XP. This resulted in migration of applications,automation scripts and everything else on new OS. In this post we will be discussing about one of the issues which I faced and most of others also had the same situation with their script while migrating to Windows 7 i.e  ADODB connection on Window 7 using VBScript. 

ADODB connection is used in VBScript to connect to the Database(Oracle/Sybase/DB2/SQL Server/Excel) and fetch the required data from databases .We have one of such VB script file which fetches the values from Database using ADODB object.The vbs file was getting executed without any error on Windows XP. But when we tried to execute it on Windows 7  ,we received the below error :

The reason for the above error is related to the way the VB Script communicates with the Operating System. Windows 7 is of  64 bits while the ADODB driver is available only in 32 bits.When the VBScript file is invoked on 64 bits OS ,by default it will be invoked by 64 bit Wscript/CScript interpreter which lead to ADODB error.

To resolve ADODB connection issue ,follow the below steps:

Instead of opening command line everytime,batch file can be created by following the below steps:

 Note : You don’t need to use the 32 bit WScript/CScript interpreter everytime while using the vbs file.It is only needed when you are doing connections to Database/Quality Centre/ALM.

Hope this article helps you in your smooth migration of your automation script from Windows XP to Windows 7 by resoling ADODB connection issues.If you face any issues related to the migration of automation scripts feel free to contact us.

Till then

Happy learning!!!!

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.