in reply to Perl OLE DB foxpro

The DBD::ADO documentation states:

"Changing the CursorType is a solution to the following problem:"

Can't execute statement 'select * from authors': Lasterror : -2147467259 ....

Perhaps worth testing.

Replies are listed 'Best First'.
Re^2: Perl OLE DB foxpro
by ajay_perl (Initiate) on Apr 12, 2011 at 06:10 UTC

    Use cursor type like this

    $q="SELECT order_bill_n, srok_date FROM orders WHERE ALLTRIM(UPPER(ord +er_bill_n)) LIKE '%22134%' order by order_bill_n desc "; $sthfox=$dbhfox->prepare($q, { ado_cursortype => 'adOpenForwardOnl +y' }) or die "Can't prepare statement: $DBI::errstr"; $sthfox->execute() or die "Can't execute statement: $DBI::errstr";

    Error changed:

    OLE exception from "Microsoft OLE DB Provider for Visual FoxPro":\r [error] \r [error] Unable to create temporary work files.\r [error] \r Win32::OLE(0.1704) error 0x80004005: "Unspecified error"\r in METHOD/PROPERTYGET "Open" at D:/usr/local/bin/perl/site/lib/DBD/ADO +.pm line 1136\r DBD::ADO::st execute failed: Can't Open Recordset for 'SELECT order_bi +ll_n, srok_date FROM orders WHERE ALLTRIM(UPPER(order_bill_n)) LIKE ' +%22134%' order by order_bill_n desc '\r
      [error] Unable to create temporary work files.

      It looks as though you don't have write access to where the driver is trying to write these temp files. This could be TMP or TEMP on Windows, or somewhere else depending how foxpro works (I've no idea, I've never used it). I'd check the eventlog to see if there is anything related to this, or see if one of the sysinternals tools may be able to help you find out what's going on. Perhaps reading some of the google search results will provide an answer.