Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 ntext

Author  Topic 

thePhoolish
Starting Member

22 Posts

Posted - 2002-11-16 : 11:10:17
..I have a table with a ntext column,
I'm trying to update this from asp, and have been working solid on this for the last 2 days, without luck. the SP works fine, just the ASP part doesn't, i've been to numerous sites, but most people shy away from this subject....

ALTER PROCEDURE SP_UpdateArticles
(
@strSectionId varchar(3),
@txtContent ntext
)
AS

DECLARE @descrip binary(16)
SELECT @descrip = TEXTPTR(content)
FROM articles
WHERE sectionid = @strSectionId
WRITETEXT articles.content @descrip @txtContent

This is my latest attempt in asp... ....I'm lost as to how to do this


strContent = Replace( Request.Form("content"), "'", "''" )
strSectionId = Request.Form("sectionId")

SET objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "driver={SQL Server};server=localhost;uid=sa;pwd=******;database=dev"
Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = objConn
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText = "SP_UpdateArticles"
objCmd.Parameters.Append objCmd.CreateParameter("@strSectionId", adVarchar,adParamInput,3,strSectionId)
objCmd.Parameters.Append .CreateParameter("@txtContent", adLongVarChar,adParamInput,1073741823,strContent)
objCmd.Execute

objConn.Close
Set objConn = Nothing


ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-11-16 : 17:55:04
Your missing objCmd in front of .CreateParameter.

What is the error you're getting?


This might also help.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=uP1KAr7GCHA.2640%40tkmsftngp11&rnum=5&prev=/groups%3Fq%3Dntext%2Bfield%2Bin%2Bado%2Bparameter%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DuP1KAr7GCHA.2640%2540tkmsftngp11%26rnum%3D5


Edited by - ValterBorges on 11/16/2002 17:57:34

Edited by - ValterBorges on 11/16/2002 18:03:38
Go to Top of Page

thePhoolish
Starting Member

22 Posts

Posted - 2002-11-17 : 09:36:30
Hi.. I've got the insert sorted using AppendChunk on the record set field.. ...problem I have now, is to post 200,000 characters from a web form to the database, working on posting using multitype.. reading the binary.. converting the binary then saving to the DB.

Is there any other way I can post this chunk of 200,000 characters into the DB, I really need to insert this data ASAP

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-11-19 : 14:53:52
You can use aspupload component to upload form text (up to a 2 GIG)and generate a file, then store the path to the file in the database?



Edited by - ValterBorges on 11/19/2002 16:52:55
Go to Top of Page

thePhoolish
Starting Member

22 Posts

Posted - 2002-11-19 : 16:47:24
not really.. it needs to be searchable using Full-Text search.

..I've tried importing text from a file, then updating.. but the script keep's timing out

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2002-11-19 : 16:56:35
Ok, can still use aspupload to write to file on server and then bulk insert into database.

Check your connection timeout settings for your the database and for the web server?

Go to Top of Page

thePhoolish
Starting Member

22 Posts

Posted - 2002-11-22 : 20:09:24
some good ideas there.. can't set the timeout myself, it's a hosted server.. ...until then I'll just have to use QA to upload.. thanks for your help..

Go to Top of Page
   

- Advertisement -