Jump to content


Photo

Adodb Connection And Ntext Types


  • Please log in to reply
No replies to this topic

#1 meistaiwan

meistaiwan
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 29 June 2006 - 08:26 PM

So I've starting using SQL2005 as my backend for php.
Last project I used the mssql libraries to connect, this project I need unicode support so I went with ADODB.

It's working fine so far, until I got to large data types. My connection string looks like this:
$db = new COM("ADODB.Connection") or die("Cannot start ADO");
$dsn = "Driver={SQL Server}; Server=xxxx,1533; Database=TCxxxct; UID=wxxx; PWD=!xxxx?;";
$db->Open($dsn);

$rs = $db_connection->Execute("SELECT Comments, submitted_by, CONVERT(varchar,date_submitted,20) as date_submitted
FROM comments
WHERE ([Customer Number] = ".$_GET['id'].")");

this part here
echo $rs->Fields['Comments']->Value."</b></i></td></tr></table>";

gives 0 for the 'Comments' Value. If I convert it to varchar(255) before sending it to adodb, it works as the rest of my values(works for numbers, varchar, nvarchar, etc).
With this ntext field, the following things happen:
->Value returns 0
->ActualSize returns -1

I've tried Fields['Comments']->GetChunk(8000), returns some kind of error.

Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft OLE DB Provider for ODBC Drivers Description: Multiple-step OLE DB operation generated errors. Check each

Anybody have some working code or know of how this is supposed to work?

Thanks,
Jimmy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users