php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36435 Executing SQL directly; no cursor error
Submitted: 2006-02-17 23:08 UTC Modified: 2007-07-31 01:00 UTC
Votes:14
Avg. Score:3.6 ± 1.2
Reproduced:12 of 12 (100.0%)
Same Version:4 (33.3%)
Same OS:7 (58.3%)
From: rvest at policytech dot com Assigned:
Status: No Feedback Package: ODBC related
PHP Version: 5.1.2 OS: Windows XP Professional
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rvest at policytech dot com
New email:
PHP Version: OS:

 

 [2006-02-17 23:08 UTC] rvest at policytech dot com
Description:
------------
I ran a query against a Microsoft SQL Server 2005 through ODBC. It is a DNSless connection using the Native Client for Microsoft SQL Server 2005. I am using the SQL_CUR_USE_DRIVER cursor in the odbc_pconnect function. I get the error "Executing SQL directly; no cursor." when using the odbc_exec function.

Actual result:
--------------
[17-Feb-2006 14:18:19] VERSION: 4.000.5
REFERER: http://localhost/Content_Redirect.php?Section=Home
SCRIPT_NAME: /c_Home/index.php
SCRIPT_FILENAME: C:\vestws\bin\c_Home\index.php
ERROR NUMBER: 1024
BROWSER: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.50727)
System: Windows NT REBECCA 5.1 build 2600
FILE: C:\vestws\bin\includes\inc_db.php
LINE: 1533
ERROR: [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.
BACKTRACE:
---------------------
#0  errHand(1024, [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor., C:\vestws\bin\includes\inc_db.php, 1533, Array ([type] => 97,[msg] => [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.,[ex] => DBException Object ([] => Array ([dbHost] => rebecca\sqlexpress,[dbType] => 2005_mssql,[dbName] => wksp4_0,[dbUsername] => sa,[dbPass] => imagin,[dbPort] => 3268,[dbFilename] => ,[mysql_usetransactions] => ,[use16BitChars] => ),[] => [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.,[] => Resource id #24,[] => 97,[] => [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.,[] => ,[] => 97,[] => C:\vestws\bin\includes\inc_db.php,[] => 1527,[] => Array ([0] => Array ([file] => C:\vestws\bin\includes\inc_db.php,[line] => 439,[function] => throwError,[class] => DB,[type] => ->,[args] => Array ([0] => 97,[1] => [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.)),[1] => Array ([file] => C:\vestws\bin\includes\inc_db.php,[line] => 226,[function] => _Execute,[class] => DB,[type] => ->,[args] => Array ([0] => SELECT GroupID, GroupName FROM xUsersPermissions INNER JOIN Groups ON Groups.Group = xUsersPermissions.GroupID AND Groups.GroupName <> '' WHERE PermissionCode = 'dca' AND UserID = 2,[1] => )),[2] => Array ([file] => C:\vestws\bin\c_home\index.php,[line] => 40,[function] => Execute,[class] => DB,[type] => ->,[args] => Array ([0] => SELECT GroupID, GroupName FROM xUsersPermissions INNER JOIN Groups ON Groups.Group = xUsersPermissions.GroupID AND Groups.GroupName <> '' WHERE PermissionCode = 'dca' AND UserID = 2)))))) called at [(null):0]
#1  trigger_error([Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.) called at [C:\vestws\bin\includes\inc_db.php:1533]
#2  DB->throwError(97, [Microsoft][SQL Native Client][SQL Server]Executing SQL directly; no cursor.) called at [C:\vestws\bin\includes\inc_db.php:439]
#3  DB->_Execute(SELECT GroupID, GroupName FROM xUsersPermissions INNER JOIN Groups ON Groups.Group = xUsersPermissions.GroupID AND Groups.GroupName <> '' WHERE PermissionCode = 'dca' AND UserID = 2, ) called at [C:\vestws\bin\includes\inc_db.php:226]
#4  DB->Execute(SELECT GroupID, GroupName FROM xUsersPermissions INNER JOIN Groups ON Groups.Group = xUsersPermissions.GroupID AND Groups.GroupName <> '' WHERE PermissionCode = 'dca' AND UserID = 2) called at [C:\vestws\bin\c_home\index.php:40]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-04 12:16 UTC] markvt at home dot nl
This error occurs when your query is not correct.
 [2007-07-23 12:07 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

And try this with the PDO ODBC driver instead.
 [2007-07-31 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".
 [2008-08-13 12:58 UTC] phpbug at tab1 dot clara dot co dot uk
I still get this error with 5.2.6 
Adding SQL_CUR_USE_ODBC as the last parameter to odbc_connect seems to cure it, not sure if there are drawbacks to using that option though.
 [2011-09-11 11:41 UTC] MATHESHWARAN at IN dot COM
cHECK THE ACCESS FOR THAT PERTICULAR DATABASE AND SERVER WITH THE uSER WHICH YOU LOGGED INT.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC