The Missing x64 JET

Recently I was helping a scripter out in one of the many scripting forums I frequent. He had a script that uses ADODB to parse information from a CSV file.  It works fine on 32 bit platforms.  But when he went to run it on an x64 platform, no luck. You’ll get an error about no provider found. And there isn’t. Microsoft did not port the 32 bit JET database drivers to the 64 bit platform, nor are there any plans to.  The only 64 bit driver you’ll likely find installed by default is for SQL.

If you have scripts that use code like this:

objConnection.Open “Provider=Microsoft.Jet.OLEDB.4.0;” & _
          “Data Source=” & strPathtoTextFile & “;” & _
          “Extended Properties=”“text;HDR=YES;FMT=CSVDelimited”“”

objRecordset.Open “SELECT * FROM ” & strFile, _
          objConnection, adOpenStatic, adLockOptimistic, adCmdText

they will not run on a 64 bit platform.  Unless…..you run your script in 32 bit mode.  To do this you need to use the versions of CSCRIPT.EXE or WSCRIPT.EXE that reside in %WINDIR%\SysWOW64:

%windir%\syswow64\cscript c:\scripts\parsecsv.vbs

This should work. In the SysWOW64 directory you should see a number of odbc 32 bit drivers. If you run odbcad32.exe from this directory you should see all your familiar drivers.

So, you can still use your old scripts; they just have to be run in 32 bit mode.  If you have other issues running your scripts on an x64 platform, please start a discussion thread at ScriptingAnswers.com.

I’m just now getting into the 64 bit world myself so I expect there will be many more surprises.

Technorati tags: , , , , ,

del.icio.us tags: , , , , ,