Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Strings

Status
Not open for further replies.

nickdel

Programmer
May 11, 2006
367
0
0
GB
What I have is a basic search function. I use the search results for form some XML which I am saving to a database as well as displaying to a user. My problem is that XML is sometimes too big to store within a String variable and is therefore truncated.

Can anyone help with a solution to this, I'm just not thinking logically today!

Thanks

Nick
 

I assume by "String variable" you mean a varchar in your database ? in which case use a text/ntext data type (if you are using Access then I recall it's called 'memo' or something) or better still use the native XML Data type in sql server 2005+, oracle 9i+, db2v9 etc (I doubt access has this).

If you mean the memory space for an ASP string variable, then you've got big problems if a relatively small xml document max's out your physical and virtual memory...

A smile is worth a thousand kind words. So smile, it's easy! :)
 
damber, the DB is not a problems as I am storing as ntext, it is unfortunately the ASP variable. It doesn't error or anything it just stops adding to the string. This happens at about 1500 characters.
 

post your code.

first, try adding response.write after all the additions to the string. If this is ok, then the problem is in the upload to the db... you might want to let us know if you're connecting via ODBC, or a dsn-less connection string.

string concatenation in vbscript is useless (really inefficient), but it should store more than 1500 chars - so you will need to show us the code that creates the problem, as this is abnormal behaviour.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
What if the variable is OK and the Response buffer is full?

Maybe it needs a .Flush
 

it depends on if the db stored data is the problem or the data displayed to the user, but certainly if it's the user presentation only, then .Flush could well be the problem - good thinking.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
I dunno, 1500 characters seems small to cause the buffer to hiccup or a string variable to hiccup. If I wasn't feeling lazy I'd switch to the windows box to put together a quick test script, but I am 100% sure I have done more than 1500 characters to the Response Buffer without problems and mostly sure I have done the same with a string variable.
 
It turns out I was just doing something REALLY stupid and have sorted this now. I'm putting several thousand characters into the buffer now and it's all fine.

Thanks for the responses.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top