CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
>>Development (Web and Desktop) >> Web Development >> ASP (Active Server Pages)

ADODB.Parameters error '800a0e7c' Parameter object is improperly defined

Article ID: 8 - Date Created Sunday, September 26, 2010 - This Article Has been Viewed 13700 times.
Article was last updated on: Wednesday, December 29, 2010 - Written By:

ADODB.Parameters error '800a0e7c' Parameter object is improperly defined

CFF Knowledge Base - Share on MySpace CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
Share With Friends (Updated 6-8-2010)
There are different variants of this code, we will list them all here as they become available.

Sometimes the error refers to misnaming your Parameter.

If you run your script with a misnamed parameter, you may receive this error

ADODB.Parameters error '800a0e7c'
Parameter object is improperly defined. Inconsistent or incomplete information was provided.
Script.asp, line 10

Recreate Issue
To recreate this issue, misname your parameters.

This will also happen if you mispell the parameters name:
should be

Resolve Issue
Example of the different types of Parameter errors in this case are as listed.

Example, we are Quering a ID (MemID) of DataType Integer

sqlMyGalCount.Parameters.Append sqlMyGalCount.CreateParameter("@MemID", adVarChar,adParamInput, , sqlID)

As you can see in the above, we have set it's Constanant as: adVarChar
Thus causing the error.
To fix this, change adVarChar to adInteger

sqlMyGalCount.Parameters.Append sqlMyGalCount.CreateParameter("@MemID", adInteger,adParamInput, , sqlID)

If you are using a Field of DataType = VarChar

NewAssoc.Parameters.Append NewAssoc.CreateParameter("@SPPass", adVarChar, adParamInput,, SPID)

As you can tell, you are missing the Length of the Field.

NewAssoc.Parameters.Append NewAssoc.CreateParameter("@SPPass", adVarChar, adParamInput, 25, SPID)

If you are using a Field of DataType = DateTime

sqlUpdate.Parameters.Append sqlUpdate.CreateParameter("@RevDate", adDatetime, adParamInput, ,date())

Try changing the adDateTime to adVarChar
Make sure that within your Table Column that you do not have a default value of: (getdate())
This will cause another error.

sqlUpdate.Parameters.Append sqlUpdate.CreateParameter("@RevDate", adVarChar, adParamInput, 25,date())

If you mispell the Parameters name, you will also get this error.
So if we have:

sqlUpdate.Parameters.Append sqlUpdate.CreateParameter("@MyID", adIntger, adParamInput, ,getMyID)

In the above, we have misspelled the Parameter Name adIntger

sqlUpdate.Parameters.Append sqlUpdate.CreateParameter("@MyID", adInteger, adParamInput, ,getMyID)

The above is spelled properly.

This will allow for the insert to happen