Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large Text in ASP & SQL Server 7

Status
Not open for further replies.

Kinl

Programmer
Mar 19, 2001
168
US
I have this storeD procedure that inserts info into a database for me, and I have a page that has a subject and a large field (textarea) for the message. Sometimes this field will get up to 6000 characters big, so I just used a varchar(8000) for this. (I'm usgin SQL Server 7).
When I pass my value from the HTML page into a asp page (the next page in line), i put it into a variable, and then use ADO to execute the SQL. I get an error. But if I do a plain insert w/ the same data, i have no problem.

Here is the error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]The identifier that starts with 'this is s testthis is s testthis is s testthis is s testthis is s testthis is s testthis is s testthis is s testthis is s testth' is too long. Maximum length is 128.
/dev/addrelease.asp, line 12


Here is my asp:

Call Connection()
Dim Info, Headline, stuff
Info = TRIM(Request.Form("info"))
Headline = TRIM(Request.Form("headline"))
objConn.Execute SQL
Call CloseConnections()


Here is my SPROC:

CREATE proc spPR_ReleaseInsert
@UPDATE varchar(8000),
@HEADLINE text,
@PRIORITY int
AS

INSERT INTO PR_Releases
(tstamp, headline, release, priority)
VALUES (GETDATE(), @HEADLINE, @UPDATE, @PRIORITY)



Any ideas? Thanx man
 
Opps..
here is the ASP portion again.. the above was the wrong snippet.


Dim Info, Headline, stuff
Info = TRIM(Request.Form("info"))
Headline = TRIM(Request.Form("headline"))
SQL = "EXEC spPR_ReleaseInsert [" & Headline & "], [" & Info & "], 1"
objConn.Execute SQL
Call CloseConnections()

 
Does seem odd if, in fact, the field in question is specified as 8k length.

Have you tried using a command object to execute your SPROC?

dim comObj
set comObj = server.createObject("ADODB.Command")
comObj.activeConnection = objConn
comObj.commandType = 4
comObj.commandText = "spPR_ReleaseInsert"

comObj.parameters("@UPDATE").value = Headline
comObj.parameters("@HEADLINE").value = Info
comObj.parameters("@PRIORITY").value = 1
comObj.execute

In theory, it shouldn't make a difference, but I would still give it a shot... sometimes it's the method in which you call something that is causing problems.

good luck! :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top