Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > AppendChunk method with SQL Server

Reply
Thread Tools

AppendChunk method with SQL Server

 
 
Bill
Guest
Posts: n/a
 
      08-30-2004
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
SQL Server does not exist after moving to new Sql Server Geoff ASP .Net 3 01-16-2006 05:54 AM
Do the Self-Paced Training Kits: Microsoft SQL Server 2000 include Eval copy of SQL Server? Brian Whiting Microsoft Certification 2 12-29-2005 04:24 AM
sql server express vs sql server 2000 code Daves ASP .Net 1 06-13-2005 12:24 PM
Can't connect to SQL Server, using Windows Authentication users of SQL server? help =?Utf-8?B?UmV6YQ==?= ASP .Net 3 06-07-2004 06:42 PM



Advertisments