Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.