Forum Discussion
AlexKaras
10 years agoChampion Level 3
Hi Sushil,
> But same line of code gives unspecified error [...]
Could you be more specific about what exact line errors out?
> 32 bit driver is installed & above code runs fine in VBS file.
If you are running vbs using command prompt started from <Windows>\System32 this means that you are running it in 64-bit environment. (To double check this start TaskManager and check the bitness of the cscript or wscript processes.)
> DB_CONNECTION_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\NIX Automation\Codebase\DB\DB.mdb;"
This connection string makes me think that you are connecting to the Access via DNS, is this correct?
If my guess is correct, then the DNS must be recreated in the 32-bit environment of your machine as well. In order to do this start odbcad32 utility from the <Windows>\SysWOW64\ folder.
> But same line of code gives unspecified error [...]
Could you be more specific about what exact line errors out?
> 32 bit driver is installed & above code runs fine in VBS file.
If you are running vbs using command prompt started from <Windows>\System32 this means that you are running it in 64-bit environment. (To double check this start TaskManager and check the bitness of the cscript or wscript processes.)
> DB_CONNECTION_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\NIX Automation\Codebase\DB\DB.mdb;"
This connection string makes me think that you are connecting to the Access via DNS, is this correct?
If my guess is correct, then the DNS must be recreated in the 32-bit environment of your machine as well. In order to do this start odbcad32 utility from the <Windows>\SysWOW64\ folder.