I have just uploaded 1.32_2 development release of DBD::ODBC. This contains one rather nice enhancement for Windows users which adds the new odbc_driver_complete attribute described as below. This allows DBD::ODBC on Windows to obtain a window handle which means if the ODBC Driver Manager or ODBC Driver needs to throw a dialogue to complete the data source or perhaps re-enter an expired password it can. Any testing will be greatly appreciated. The full changes since 1.31 are:
Changes in DBD::ODBC 1.32_2 October 22 2011
Changes in DBD::ODBC 1.32_1 June 24 2011
This attribute was added to DBD::ODBC in 1.32_2.
odbc_driver_complete is only relevant to the Windows operating system and will be ignored on other platforms. It is off by default.
When set to a true value DBD::ODBC attempts to obtain a window handle and calls SQLDriverConnect with the SQL_DRIVER_COMPLETE attribute instead of the normal SQL_DRIVER_NOPROMPT option. What this means is that if the connection string does not describe sufficient attributes to enable the ODBC driver manager to connect to a data source it will throw a dialogue allowing you to input the remaining attributes. Once you ok that dialogue the ODBC Driver Manager will continue as if you specified those attributes in the connection string. Once the connection is complete you may want to look at the odbc_out_connect_string attribute to obtain a connection string you can use in the future to pass into the connect method without prompting.
As a window handle is passed to SQLDriverConnect it also means the ODBC driver may throw a dialogue e.g., if your password has expired the MS SQL Server driver will often prompt for a new one.
An example is:
As this only provides the driver and further attributes are required a dialogue will be thrown allowing you to specify the SQL Server to connect to and possibly other attributes.