Skip to Content.
Sympa Menu

freetds - [freetds] cursor not working with freetds driver

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Dave <david AT tomato.it>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] cursor not working with freetds driver
  • Date: Wed, 19 Mar 2003 17:02:53 +0100

Hi I have a "small" problem using cursor, I'm using this code to make a query:

$query="SELECT * FROM sec_ta_utente";
$first=first_row;
$connection=mssql_connect($host,$user,$password) or die('unable to connect');
mssql_select_db('passport', $connection) or die('unable to select');
mssql_query("DECLARE select_cursor SCROLL CURSOR FOR $query FOR READ ONLY",$connection) or die('unable to execute:' . $query);
mssql_query("OPEN select_cursor",$connection) or die('unable to execute:' . $query);
if($result=mssql_query("FETCH ABSOLUTE ".($first+1)." FROM select_cursor",$connection) or die('unable to execute FETCH ABSOLUTE!'))
{
mssql_fetch_row($result);
if($row_result=mssql_query("FETCH FROM select_cursor",$connection))
{
if(mssql_num_rows($row_result))
mssql_fetch_row($row_result);
mssql_free_result($row_result);
}
mssql_free_result($result);
}
mssql_query("DEALLOCATE select_cursor",$connection) or die('unable to execute DEALLOCATE!');
mssql_close($connection);

the script always exits at this line: unable to execute FETCH ABSOLUTE!

I'm using freetds with FreeBSD 4.7 + Apache 1.3.27 + PHP 4.2.1.
I compiled freetds from ports.
I'm using Microsoft SQL server 2000 installed on Win 2000 server.

Any suggestions or is this a bug in freetds drivers ?

Thanks in advance

Bye, Dave




Archive powered by MHonArc 2.6.24.

Top of Page