MS SQL Server 2012 returns empty text?

I execute this inside MS SQL Server Management Studio:

SELECT TOP 2 * FROM searchdb.dbo.tblnames;

I am returning two messages with complete information.

When I do the same on a web page, I get all the information except the text that is empty.

Type of text columns in the database:

ntext

The connection string I am using is:

Driver={SQL Server};Server=localhost;Database=searchdb;Uid=myuser;Pwd=mypass;

I also tried:

Driver={SQL Server Native Client 11.0};Server=localhost;Database=searchdb;Uid=myuser;Pwd=mypass;

Getting the same result. I don’t know the difference between “SQL Server” and “SQL Server Native Client 11.0”, just “SQL Server” has a newer date in the list of ODBC data sources.

What's happening? Why does it return empty text? How to fix it?

Edit: Here is the code I use on ASP webpages:

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={SQL Server};Server=localhost;Database=searchdb;Uid=myuser;Pwd=mypass;"

Set RecSet = Conn.Execute("SELECT TOP 2 * FROM tblnames;")
    Response.Write "ID: "& RecSet("ID") &"<br>"
    Response.Write "Name: "& RecSet("name") &"<br>"
    Response.Write "Mark: "& RecSet("mark") &"<br>"
    RecSet.MoveNext
    Response.Write "ID: "& RecSet("ID") &"<br>"
    Response.Write "Name: "& RecSet("name") &"<br>"
    Response.Write "Mark: "& RecSet("mark") &"<br>"
Set RecSet = Nothing

ID Mark "int" , "name" .

2:

Users with less than 10 reputation can't answer their own question
for 8 hours after asking. You can answer 3/15/2014 4:16:50 AM. Until
then please use comments, or edit your question instead.

, stackoverflow ( ), . , - . - , , .

, :

Self-:

:

Provider=SQL Server Native Client 11.0;Server=localhost;Database=searchdb;Uid=myuser;Pwd=mypass;

.

, , "", . , "Provider = SQL Server" , "Driver = {SQL Server}" , "Driver = {SQL Server Native Client 11.0}" ( ).

, . "" > "" > " ODBC".

, , , , , .

+4
1

, , , . , , ntext . , .

http://databases.aspfaq.com/database/how-do-i-deal-with-memo-text-hyperlink-and-currency-columns.html

SQL Server , ASP

EDIT:

ntext nvarchar SQL-.

SELECT TOP 2 ID, Mark, CONVERT(NVARCHAR(MAX), Name) [Name] FROM tblNames
0

Source: https://habr.com/ru/post/1531848/


All Articles