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. Any testing will be greatly appreciated. The full changes since 1.31 are:

=head2 Changes in DBD::ODBC 1.32_2 October 22 2011

  [ENHANCEMENTS]

  * Added new odbc_driver_complete attribute allowing the ODBC Driver
    Manager and ODBC Driver to throw dialogues for incomplete
    connection strings or expired passwords etc.

  [OTHER]

  * added more examples

  [DOCUMENTATION]

  * new FAQ entries

=head2 Changes in DBD::ODBC 1.32_1 June 24 2011

  [BUG FIXES]

  * I omitted rt_68720.t from the 1.31 distribution which leads
    to a warning as it is mentioned in the MANIFEST.

  [OTHER]

  * Changed line endings in README.af and README.unicode to be unix
    line endings and native eol-style in subversion.

  * Minor changes to Makefile.PL to save the opensuse guys patching.

  * Added unicode_sql.pl and unicode_params.pl examples


=head3 odbc_driver_complete

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:

my $h = DBI->connect('dbi:ODBC:DRIVER={SQL Server}', "username", "password",
                       {odbc_driver_complete => 1});

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.

Martin

Reply via email to