Friday, March 23, 2012

ODBC 32/64 bit

Related to http://support.microsoft.com/kb/942976, if you call Cscript from a 64 bit environment you may end up in a 64 bit ODBC world.

E.g. when calling from 64 bit GAMS using

$call cscript script.vbs

I encountered:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Provider:MSDASQL  Version:6.1 
C:\projects\erwin\script.vbs(10, 1) Microsoft OLE DB Provider for ODBC Drivers:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

To get into the 32 bit world use:

$call \windows\syswow64\cscript script.vbs

Now we get more normal behavior:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Provider:MSDASQL  Version:6.1
MySQL version: 5.5.20