Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2007, 11:10 PM
Junior Member
 
Join Date: Jul 2007
Posts: 11
Default Problems with SQL Server and nText fields

Hello! Sorry for all the questions. I'm trying to do a very simple query against a SQL Server database. The application that I'm creating must be able to access a client's old data. Here's the query:

$sql = "SELECT * FROM Communities";
$results = $this->db->fetchAll($sql);

This is throwing an error message:

General error: 10007 Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.

The Communities table contains a few ntext fields, which seem to be triggering the error. If I change the query to avoid selecting the ntext fields (SELECT Name FROM Communities), it works just fine. How does one work around this?

Thanks!
- Bret
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-29-2007, 10:06 PM
Junior Member
 
Join Date: Oct 2007
Posts: 3
Default Possible solution when using freetds

I've had this problem before. I was using linux and freetds, and the tds version I was using for the DB host was too old. You should have something like this in your freetds.conf:

Code:
[dbhost]
        host = dbhost
        port = 1433
        tds version = 8.0
The 'tds version' line is the most important. If you don't specify a version for a specific host, your system will use the [global] configuration declared in your freetds.conf, which usually uses a much older tds version.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-30-2007, 05:39 PM
Junior Member
 
Join Date: Jul 2007
Posts: 11
Default

Thanks. I also learned that if I converted the fields from nText to just Text, that should solve the issue as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-30-2007, 09:07 PM
Junior Member
 
Join Date: Oct 2007
Posts: 3
Default

Converting the fields from nText to Text will work around the problem if you don't want to store any unicode characters in those fields.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:04 AM.