Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: error with command parameter (namely of type text, adLongVarChar)


Message #1 by agaisin@c... on Sun, 17 Feb 2002 16:47:13 +0000
(using sql server 2000)

I am in the process of optimizing a number of asp pages.

I'm in the middle of removing all calls to parameters.refresh and instead

manually creating and appending all parameters for the stored procedures...

One of the parameters is a text field and I'm passing in the parameter like

this:

cmdUpdate.Parameters.append cmdUpdate.CreateParameter ("@sAvailability"

,adLongVarChar,adParamInput,2147483647,Request.QueryString("Availability") )



(really on one line)



When I do this I get the error:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Cannot create a row of size 9605 which is greater than the allowable maximum

of 8060.

/edvaps10/Abstracting.asp, line 583



Also, I tried to create it this way:

cmdUpdate.Parameters.append cmdUpdate.CreateParameter ("@sAvailability"

,adChar,adParamInput,len(Request.QueryString("Availability")),Request.QueryS

tring("Availability") )



(again on one line)

but I get this error:

ADODB.Parameters error '800a0e7c'

Parameter object is improperly defined. Inconsistent or incomplete

information was provided.

/edvaps10/Abstracting.asp, line 576



I then changed to this:

Here is the code I changed to:

dim paramAvailability

set paramAvailability = cmdUpdate.CreateParameter("@sAvailability",adLongVarChar,adparaminput,2147483647)

paramAvailability.appendChunk Request.QueryString("Availability") 

cmdUpdate.Parameters.append paramAvailability



as someone informed me that appendchunk is the appropriate way to insert data into a text field...

so I changed to using appendChunk of Parameter object but I am still getting the same error:

Microsoft OLE DB Provider for SQL Server error '80040e14' 

Cannot create a row of size 9605 which is greater than the allowable maximum of 8060. 

/edvaps10/Abstracting.asp, line 587



Any ideas why it still is giving me this error? What is this error caused by?

Also still curious about two things:

1) I'm using sp_procedure_params_rowset (as oledb provider does when I called parameter.refresh) to determine the order, types and
sizes of the parameters.

I see that it maps char, varchar, and text to adchar data types.

Is this some sort of optimization? Should we be doing the same?



2) also, I have seen code like this, not using appendchunk() on text types, yet it works?:

cmd.Parameters.Append cmd.CreateParameter("@description", adLongVarChar, _

adParamInput, 2147483647, description)



Is it just "proper" to use appendChunk for text types or are there times where code will fail otherwise?





Any help and added information/resources is greatly appreciated!

Thx,

Arthur Gaisin






  Return to Index