php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29669 Setting ADO RecordSet CursorLocation to adUseClient causes query delay
Submitted: 2004-08-14 03:29 UTC Modified: 2005-02-23 01:00 UTC
From: www dot spam at whoah dot net Assigned:
Status: No Feedback Package: COM related
PHP Version: 5.0.1 OS: Windows 2000 Professional
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: www dot spam at whoah dot net
New email:
PHP Version: OS:

 

 [2004-08-14 03:29 UTC] www dot spam at whoah dot net
Description:
------------
When attempting to use ADODB.RecordSet COM object to query an MS Access database via a DSNless connection, setting the CursorLocation to adUseClient causes a significant delay on the processing of a query execution. 

ASP has no such issue with this, so maybe PHP's support can be improved (client-side cursor location allows the use of additional RecordSet features such as ->Sort() and ->Filter(), handy for porting ASP code that uses it instead of writing a dynamic query).

Any database and query should reproduce this, so please modify the 'reproduce code' appropriately (to point to your own database and use your own query).

Reproduce code:
---------------
define("adLockReadOnly",1);
define("adOpenStatic",3);
define("adUseClient",3);

function simpleRS($conn,$q) {
	$rs = new COM('ADODB.RecordSet');
	$rs->ActiveConnection = $conn;
	$rs->LockType = adLockReadOnly;
	$rs->CursorLocation = adUseClient; //comment this line to remove the delay
	$rs->CursorType = adOpenStatic;
	$rs->Source = $q;
	echo 'opening... '; $rs->Open(); echo 'done';
	return $rs;
}

$dbconn = new COM('ADODB.Connection');
$dbconn->open('Provider=Microsoft.Jet.OLEDB.4.0; Data Source='. realpath('../../data/phpbb2.mdb'));
$rsUserList = simpleRS($dbconn,'SELECT * FROM phpbb_users');
$dbconn->close();

Expected result:
----------------
opening... *almost instant* done

Actual result:
--------------
opening... *delay* done

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-14 04:13 UTC] www dot spam at whoah dot net
Further:

The delay seems to be related to the size of the results data being returned. The table referenced by my query has some 11000 records whereas the same query on another table with only a few records experiences no delay.

Querying the same table (11000 records) using a server-side cursor causes no delay.

ASP experiences no such delay using the same COM objects and routines, on the same server.
 [2005-02-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC