Sunday, June 20, 2010

Win32::ODBC bug in Windows 7

I keep getting the following error when trying to run a script that uses an access database as the backend.

ConfigDSN(): Could not add temporary DSN[911] []
"Illegal use of reserved characters []{}(),?*!@;"

The script is installed via Cava Packager and a custom Inno Setup script.
By default it gets installed into the Program Files (x86) folder of windows 7.

This is the line I am having problems with, which is trying to add a DSN for the Database.

Win32::ODBC::ConfigDSN(ODBC_ADD_DSN, $DriverType,("DSN=$DSN", "Description=Win32 ODBC DSN for Perl", "DBQ=$Dir\\$DBase", "DEFAULTDIR=$Dir", "UID=", "PWD=")) or die "ConfigDSN(): Could not add temporary DSN" . Win32::ODBC::Error();

The problem wasn't obvious at first, until I realized the $Dir variable contained the text 'Program Files (x86)'.
And the Win32::ODBC module apparently has a problem with the () around the x86 of this folder.

To resolve the problem I decided to just change the default location of the Inno Setup script from {pf} the environement variable for program files and instead hard coded it as C:\Program Files.

As always, Enjoy!

No comments:

Post a Comment