Re: nText field not displaying (ASP)

From: Val Mazur (group51a_at_hotmail.com)
Date: 05/28/04


Date: Thu, 27 May 2004 22:04:51 -0400

Hi Tony,

NTEXT is a BLOB-type field and you need to work with it differently. When
you need to read the value from any BLOB-type field, you need to use
GetChunk method of the Field, not the Value property of it

-- 
Val Mazur
Microsoft MVP
"tony" <test> wrote in message 
news:%23zihRQBREHA.3124@TK2MSFTNGP12.phx.gbl...
>I changed the datatype of a field in a SQL Server 2000 database from
> nvarchar to ntext, but now nothing is being displayed.  The "Body" column 
> of
> the datatable used to be nvarchar(8000) and the below code works fine.
> However once I changed the datatype of "Body" from nvarchar to ntext, it 
> no
> longer is displayed.  Changing the field back to nvarchar and it is fine
> again.  Is there a special way for me to retrieve ntext fields?  Any help
> will be greatly appreciated.
>
>
> set locDBConn = Server.CreateObject("ADODB.Connection")
> locDBConn.Open DSN
> sql = "SELECT * FROM Test;"
> set rs = locDBConn.Execute(sql)
>
> if (not IsNull(rs("ID"))) then
>    Response.Write("ID: " & rs("ID") & "<BR>")
> end if
>
> 'This is the nText field
> if (not IsNull(rs("Body"))) then
>    Response.Write("BODY: " & rs("Body") & "<BR>")
> end if
>
>
> -Tony
> -Web Developer
>
> 


Relevant Pages

  • ADO problems with ntext, nvarchars
    ... Having problems with ADO returning nothing from table fields of type ... ntext and nvarchar. ... and don't be so blindly stupid etc etc etc, ...
    (microsoft.public.sqlserver.programming)
  • Problems with ntext, nvarchar
    ... I am having problems in my ASP code (ADO) getting any data of type ... ntext or nvarchar from the database. ...
    (microsoft.public.sqlserver.programming)
  • nText field not displaying (ASP)
    ... I changed the datatype of a field in a SQL Server 2000 database from ... However once I changed the datatype of "Body" from nvarchar to ntext, ...
    (microsoft.public.data.ado)
  • ntext field not showing up (ASP)
    ... I changed the datatype of a field in a SQL Server 2000 database from ... However once I changed the datatype of "Body" from nvarchar to ntext, ...
    (microsoft.public.inetserver.asp.db)
  • nText field not showing up (ASP)
    ... I changed the datatype of a field in a SQL Server 2000 database from ... However once I changed the datatype of "Body" from nvarchar to ntext, ...
    (microsoft.public.inetserver.asp.general)