Wednesday, March 7, 2012

Recordset Field Limit??

Hey Everyone,

I have what seems to be a unique problem, which I am not sure if it is an ASP problem or an SQL Server issue. I'm making a website that pulls its content from ntext fields within SQL Server 2000.

Heres my problem, when I pull the data into the page it cuts off the text from the field at a certain spot. I pulled the data into a variable and did some tests on it, if I run length on it I get 1023 and also if I run length on just the recordset field I also get 1023. But if I check the SIZE of the recordset I get a return of 2046. I have had this problem before with an Access database as well but it seems as if the amount of characters that it cut off at with the access database was in the 200's. I've self taught myself ASP so this could very easily be something I have missed. Same for both Access and SQL Server.One mystery is easy enough. ntext is a double-byte system, so 1023 characters takes up 2046 bytes.

The other mystery is a bit harder to figure. What sort of variable are you retrieving the data into? If it is not declared, it is probably a variant datatype, which could top out at 1k. I am not too good with VB6 datatypes, but have you tried casting the variable as VB's equivalent of text?|||Well I'm not using ASP.Net so no type casting, and actually I wasn't originally pulling the data into a variable type, I only done so to do those tests. I am pulling the data onto the page with the following

<%=(recordset.Fields.Item("ntextfield").Value)%>

But I did set a variable equal to that to check the length and size.|||I got nothing on that. Most I have ever worked with in ASP is varchar(1000). If you retreive the value into a variable, I take it you get the same result?

And I suppose there is no possiblity of you not using ntext? Terribly finicky stuff. At least, if you can avoid using chinese/japanese/greek/hebrew letters in your text, you can demote it down to just text. Likely, you can get a way with a varchar(4000) field or something.|||It is like that cuz the data being pulled in can sometimes be up to 10000 characters long... Ugh I bet thats going to cause me major headaches before this is said and done :D

No comments:

Post a Comment