Re: nText field not displaying (ASP)

From: William Morris (news.remove.this.and.the.dots_at_seamlyne.com)
Date: 05/27/04


Date: Thu, 27 May 2004 14:44:54 -0500

Two things. First, stop using SELECT *, especially if you're writing
production code. Second, move your nText field to the last thing in the
selection list.

"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
>
>