nText field not showing up (ASP)

Discussion in 'ASP General' started by tony, May 27, 2004.

  1. tony

    tony Guest

    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
     
    tony, May 27, 2004
    #1
    1. Advertising

  2. http://www.aspfaq.com/2188

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "tony" <test> wrote in message news:...
    > 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
    >
    >
     
    Aaron Bertrand - MVP, May 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dave

    ntext to string

    dave, Dec 15, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,458
    Konrad Rotuski
    Dec 15, 2003
  2. Frank Thomas

    HtmlEncode and NText

    Frank Thomas, Jul 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    408
    Lucas Tam
    Jul 18, 2004
  3. =?Utf-8?B?U2lsZWVzaA==?=

    Urgent Converting varchar to ntext in SQL

    =?Utf-8?B?U2lsZWVzaA==?=, Nov 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    15,855
    =?Utf-8?B?U2lsZWVzaA==?=
    Nov 12, 2004
  4. =?Utf-8?B?ZGF2aWQ=?=
    Replies:
    3
    Views:
    465
    Mark Fitzpatrick
    Feb 26, 2007
  5. el_sherif
    Replies:
    2
    Views:
    111
    Tom B
    Jul 31, 2003
Loading...

Share This Page