nText field not displaying (ASP)

From: tony (test)
Date: 05/27/04

  • Next message: William Morris: "Re: nText field not displaying (ASP)"
    Date: Thu, 27 May 2004 10:59:44 -0700
    
    

    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


  • Next message: William Morris: "Re: nText field not displaying (ASP)"

    Relevant Pages

    • Re: I can not read a small file from NTEXT field in the database
      ... new XML datatype instead. ... Are you simply storing the contents of the XML file, ... That wouldn't be a ntext ... If you're working with SQL Server locally, ...
      (microsoft.public.dotnet.framework.aspnet)
    • 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 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)