Forum Moderators: open

Message Too Old, No Replies

Text Field in Recordset

Long Text Issue

         

Krapulator

11:08 pm on Dec 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi All,

I am using asp and ado to dynamically generate an XML file.

Everything works fine except for the one text field which contains <longtext> - sometimes it works and sometimes it returns empty.

The code:

response.write "<Name>" & roomType("sAccomtype") & "</Name>"
response.write "<Description>" & roomType.Fields.Item("sAccomDescript").Value
response.write "</Description>"

The Name always comes out fine (nvarchar field).
Sometimes the Description comes out fine and sometimes it is empty. If it comes out empty and the I refresh the page it comes out OK.

Im pretty sure it has something to do with the Description being longtext - but I dont know how to work around the problem.

Any suggestions?

RossWal

5:50 pm on Dec 13, 2002 (gmt 0)

10+ Year Member



Sometime ago I dealt with some big text fields in ado and had to use GetChunk and PutChunk (not certain on the PutChunk). As I recall you define your chunk size, up to a max and set up a loop to grab the data. Something like:

While {I can't remember the condition}
strMyData = strMydata & adoRS.Fields(1).GetChunk
Wend

A Google search on ADO Getchunk should yield better info. Good luck.

duckhunter

1:39 am on Dec 14, 2002 (gmt 0)

10+ Year Member



This is a known bug in an earlier verion of SQL and/or ADO. This can be corrected by putting the text field at the end of your select statement like this:

select integerfield1, datefield1, textfield1 from table1...

Not sure if there was a patch for it or not, just did the above and it corrected the problem.