June 9, 2004 at 9:12 pm
hi, i need some help here..
can someone show me a working example on how to use the command object to send very long string datatype to sql 2000? The very long string is actually an xml document. command object is from ado2.7 Using asp2.0
It works perfectly well on an ODBC connection, but once i changed it to sqloledb... it truncates the string to abt 100 i think!
here is the snippet of the code
Set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")
'load xml document into the xmldoc instance
set cm = Server.CreateObject("ADODB.Command")
cm.ActiveConnection = pubsDSN
cm.CommandText = "sp_insertXML"
cm.CommandType = 4
set p = cm.Parameters
p.Append cm.CreateParameter("RETURN_VALUE", adInteger, adParamReturnValue, 4)
p.Append cm.CreateParameter("@strXML",adLongVarChar,adParamInput, len(xmlDoc.xml))
p.Item("@strXML").AppendChunk xmlDoc.xml
cm.Execute
June 10, 2004 at 8:24 pm
Anyone? pls pls... very urgent
June 11, 2004 at 5:19 pm
It doesn't seem to be a SQL issue, sounds like a sqloledb issue since it worked in ODBC. I don't see any obvious problems with your code, but I'm no expert.
Yukon has an xml datatype, but that doesn't help much!
Really, if you want to store a string longer than 8000 characters you need to use the "text" datatype. And you can't have a text data type variable, so using procs is out of the question.
cl
Signature is NULL
June 13, 2004 at 5:28 am
What language are you using? On SQL 2k you should be able to use a text parameter and a text column type.
June 18, 2004 at 7:42 pm
Yes, but
CREATE PROCEDURE updatePage
<snip>
@strBody text,
<snip>
AS
UPDATE Page
SET
<snip>
Page.strBody = @strBody,
<snip>
WHERE
Page.intPageId = @intPageId
GO
would (does) work fine...
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply