I'm using DBD::ADO, and am having trouble with long SQL queries timing out.
I'm connecting to a MS SQL Server 2000 database, using the SQLOLEDB driver.
My connect string is:

dbi:ADO:Provider=SQLOLEDB;Data Source=\\servername;Initial
Catalog=databaseName;CommandTimeout=6000

Long running queries time out at about 30 seconds, no matter what I put for
the CommandTimeout value.  I've tried

CommandTimeout=1
CommandTimeout=0
CommandTimeout=60
CommandTimeout=6000000
Command Timeout=6000000
Timeout=600000

I've even gone as far as trying to modify the ADO.pm module to hard code a
longer/shorter value.

Is there any reason that the SQLOLEDB driver would be ignoring my requests
to lengthen (or shorten) the default timeout?  How can I tell what version
of the SQLOLEDB driver I have?  And are there global defaults for that
driver that I can set somewhere outside of Perl?

I've also tried modifying the server and initial database names, just to
make sure it's reading my connect string...and they are both being read
correctly.

Thanks in advance,
Ryan Hope

The error message I'm getting is:

Lasterror:      -2147217871: OLE exception from "Microsoft OLE DB Provider
for SQL Server":

Timeout expired

Win32::OLE(0.1502) error 0x80040e31
    in METHOD/PROPERTYGET "Open"
     Description:   Timeout expired
     HelpContext:   0
     HelpFile:
     NativeError:   0
     Number:        -2147217871
     Source:        Microsoft OLE DB Provider for SQL Server
     SQLState:      HYT00 at replenishNetwork.pl line 145.

Reply via email to