471,831 Members | 931 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,831 software developers and data experts.

AppendChunk method with SQL Server

Hi all,

I have an asp page that writes to an ntext field in SQL Server 2000.
All was going well until I had to put in a section of text greater than 8000
bytes.
Then I got a timeout error and the update wouldn't go through.
After reading that 2000 only accepts chunks of 8000 bytes or under at a
time, I attempted to use the AppendChunk method.
The code I wrote seems to work first time I enter text in the page, no
matter how big. But when I try to update the ntext file,
if it is more than 8K, it just sits there and nothing happens. Now I dont
even get a timeout error.
From what I read, I was assured this would work.
For small text files under 8K it works beautifully, I can add and remove
text and it all works fast.
But as soon as the ntext field gets beyond that size its totally unworkable,
and seems to be just the same as using the standard UPDATE method. I've
attached the code.

If anyone has any suggestions I would be eternally grateful, this is driving
me nuts. I've attached the offending code.

Thanks

Bill
' ***********************************************

' * PageStatus: SAVE Action: EDIT *

' ***********************************************

IF PageStatus = "SAVE" AND Action = "EDIT" THEN

sqlc = "SELECT * from " & tblName
Dim FldVal

Dim rs

Set rs = Server.CreateObject("ADODB.Recordset")
rs.cursortype = 1

rs.cursorlocation = 3

rs.locktype = 3
rs.Open sqlc, oConn

iChunk = 254

cTxtDescription = SQLReady(FileUp.Form(lang))

For iNo = 1 to len(cTxtDescription) step iChunk

iStartAt = iNo

cWorkString = mid(cTxtDescription, iStartAt , iChunk )

Response.Write "At byte " & iNo & vbCRLF & "<br/>"
rs.Fields("SimpleChinese").AppendChunk(cWorkString )

Next

IF Page_Err = "OK" THEN

' Perform the Query

rs.Update

rs.Close

Set rs = Nothing

Set oConn = Nothing

END IF

END IF

Jul 19 '05 #1
0 1411

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Bill | last post: by
5 posts views Thread by rk325 | last post: by
1 post views Thread by Bill Hutchison | last post: by
5 posts views Thread by rn5a | last post: by
2 posts views Thread by =?Utf-8?B?QUEyZTcyRQ==?= | last post: by
NeoPa
reply views Thread by NeoPa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.