Problem with field type nvarchar(max)

Problem with field type nvarchar(max)

am 17.01.2007 14:49:39 von maurox

Hi,
i have a simple table with a field called "authors". this filed have a
nvarchar(max) type (in MSSql 2005).

i have a simple query "Select authors FROM table". in query analizer
this return the value of authors, but when i run this in asp page, the
field is empty.

in the code i have:

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, Conn, 1, 1

but rs("Authors") is empty.

If i change the type (and i use nvarchar(4000) for authors) there is no
problem.

for the connection i have Driver={SQL Native Client}.

thanks

Re: Problem with field type nvarchar(max)

am 17.01.2007 14:55:15 von maurox

i use Win XP SP2, MDAC 2.8 SP1, IIS5.1

On 17 Gen, 14:49, "maurox" wrote:
> Hi,
> i have a simple table with a field called "authors". this filed have a
> nvarchar(max) type (in MSSql 2005).
>
> i have a simple query "Select authors FROM table". in query analizer
> this return the value of authors, but when i run this in asp page, the
> field is empty.
>
> in the code i have:
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open sql, Conn, 1, 1
>
> but rs("Authors") is empty.
>
> If i change the type (and i use nvarchar(4000) for authors) there is no
> problem.
>
> for the connection i have Driver={SQL Native Client}.
>
> thanks

Re: Problem with field type nvarchar(max)

am 17.01.2007 16:39:16 von reb01501

maurox wrote:
> Hi,
> i have a simple table with a field called "authors". this filed have a
> nvarchar(max) type (in MSSql 2005).
>
> i have a simple query "Select authors FROM table". in query analizer
> this return the value of authors, but when i run this in asp page, the
> field is empty.
>
> in the code i have:
>
> Set rs = Server.CreateObject("ADODB.Recordset")
> rs.Open sql, Conn, 1, 1
>
> but rs("Authors") is empty.
>
> If i change the type (and i use nvarchar(4000) for authors) there is
> no problem.
>
> for the connection i have Driver={SQL Native Client}.
>
> thanks
See if this helps:
http://msdn2.microsoft.com/en-us/library/ms130978.aspx

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Problem with field type nvarchar(max)

am 17.01.2007 17:22:19 von maurox

thank you!!!!

On 17 Gen, 16:39, "Bob Barrows [MVP]" wrote:
> maurox wrote:
> > Hi,
> > i have a simple table with a field called "authors". this filed have a
> > nvarchar(max) type (in MSSql 2005).
>
> > i have a simple query "Select authors FROM table". in query analizer
> > this return the value of authors, but when i run this in asp page, the
> > field is empty.
>
> > in the code i have:
>
> > Set rs = Server.CreateObject("ADODB.Recordset")
> > rs.Open sql, Conn, 1, 1
>
> > but rs("Authors") is empty.
>
> > If i change the type (and i use nvarchar(4000) for authors) there is
> > no problem.
>
> > for the connection i have Driver={SQL Native Client}.
>
> > thanksSee if this helps:http://msdn2.microsoft.com/en-us/library/ms130978.aspx
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.- Nascondi testo tra virgolette -- Mostra testo tra virgolette -