Jump to content

Adodb Connection And Ntext Types


Recommended Posts

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.

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

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

Thanks,
Jimmy
Link to comment
https://forums.phpfreaks.com/topic/13246-adodb-connection-and-ntext-types/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.