Select error: DB-library (for example, isql) cannot be used. DB-library (for example, isql)

Source: Internet
Author: User
Tags odbc mssql

You cannot use DB-Library (such as ISQL) or ODBC 3.7 or earlier versions to import ntext data.

Warning: mssql_query () [function. mssql-query]: message: ntext data or Unicode data that uses only Unicode sorting rules cannot be sent to the client using DB-Library (such as ISQL), ODBC 3.7, or earlier versions. (Severity 16) in D: PHPnowhtdocss export dedb_mssql.class.php on line 55

The code is as follows: Copy code

Warning: mssql_query () [function. mssql-query]: Query failed in D: phpnowhtdocss?dedb_mssql.class.php on line 55
MsSQL Query: SELECT * FROM PE_Config
MsSQL Error: 1
MsSQL Errno: 1
Message: MsSQL Query Error

During PB development, because the ntext field is used in the database, the following error message is Prompted. After reading a large amount of information, I finally understood the problem:
PB error: ntext data or Unicode data only using Unicode sorting rules cannot be sent to the client using DB-Library (such as ISQL) or ODBC 3.7 or earlier.

----------------

In SQL server, ntext and nvarchar fields are stored in unicode encoding. Therefore, php uses mssql extension to read ntext and nvarchar fields with errors.

If the title field type is nvarchar and the content field type is ntext, the following SQL statement reports an error:

The code is as follows: Copy code

Select title, content from article where 1

The correct statement is as follows:

The code is as follows: Copy code

Select convert (varchar (255), title) as title, convert (text, content) as content from article where 1

Or do not use the ntext field

Ntext data Warning: mssql_query () [function. mssql-query]: message: ntext data or Unicode data that uses only Unicode sorting rules cannot be sent to the client using DB-Library (such as ISQL), ODBC 3.7, or earlier versions. (Severity 16) in D: PHPnowhtdocss export dedb_mssql.class.php on line 55 Warning: mssql_query () [function. mssql-query]: Query failed in D: phpnowhtdocss?dedb_mssql.class.php on line 55 MsSQL Query: SELECT * FROM PE_Config MsSQL Error: 1 MsSQL Errno: 1 Message: MsSQL Query Error in PB development, because the database is used

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.