Varchar(max) causing other other accesses of the record set to return null

66 views Asked by At

With an SQL Server table set up as

A INT
B VARCHAR(MAX)
C INT

And accessessing this in ASP Classic

set RS = oConn.Execute("SELECT A,B,C FROM Table")

RS("A") returns A
RS("B") returns B
RS("C") returns ""

If we access C before B then we can get the value of C but if we ever use B then all subsequent RS calls return ""

One 'fix' we have found for this is changing the order of the fields in the table so

A INT
C INT
B VARCHAR(MAX)

But quite often we just use a SELECT B FROM Table

I'm guessing it is due to the older ADODB drivers not knowing what varchar(max) is or when it comes to an end. Is there any documentation of this anywhere?

Thanks

0

There are 0 answers