IIS ASP - nText field not showing up (ASP)

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > May 2004 > nText field not showing up (ASP)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author nText field not showing up (ASP)
tony

2004-05-30, 11:54 am

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

2004-05-30, 11:54 am

http://www.aspfaq.com/2188

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




"tony" <test> wrote in message news:u88CLMBREHA.1392@TK2MSFTNGP09.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
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com