# Miscellaneous > Database Programming >  Error 80040e21

## Andy Milk

I&#39;m getting this message:

Microsoft OLE DB Provider for ODBC Drivers error &#39;80040e21&#39; 

Errors occurred 


When I try to pull up a page with an primary key ID that&#39;s larger than 127.

Has anyone seen this problem or know what this error is?

-Andy Milk

----------


## John

Hi Andy,

Define &#34;pull up a page&#34;?  You&#39;re using ASP-db to do this?

What database?

Does this only happen when the key value exceeds 127?

What line are you getting the error on?

Do you get this error when you run pureasp.asp ?

This will help us troubleshoot with you.

Thanks,
John


On 2/9/99 4:33:50 PM, Andy Milk wrote: 
> I&#39;m getting this message:

Microsoft OLE DB Provider for ODBC Drivers 
> error &#39;80040e21&#39; 

Errors occurred 


When I try to pull up a 
> page with an primary key ID that&#39;s larger than 127.

Has anyone seen 
> this problem or know what this error is?

-Andy Milk

----------


## Andy Milk

I&#39;m sorry, I wasn&#39;t very specific about my problem.

I am using ASP with SQL Server 6.5

The code that I&#39;m using is:

	SET cmdProduct = Server.CreateObject(&#34;ADODB.Command&#34 :Wink: 
	cmdProduct.ActiveConnection = &#34;DSN=xxxx;UID=xxxx;PWD=xxxx;&#34;
	cmdProduct.CommandText = &#34;qProduct&#34;
   cmdProduct.CommandType = 4
	Set prmProduct = cmdProduct.CreateParameter(&#34;pProductID&#34 :Wink: 
	prmProduct.Type = adTinyint
	prmProduct.Direction = adParamInput
	prmProduct.Size = Len(ProductID)
	prmProduct.Value = ProductID
	cmdProduct.Parameters.Append prmProduct

	Set rsProduct = Server.CreateObject(&#34;ADODB.Recordset&#34 :Wink: 
        rsProduct.Open cmdProduct, , adOpenKeyset, adCmdTable


I&#39;m creating a command object with an ActiveConnection, adding a parameter to it, and then creating a recordset with the command.

The last line of code gives me the error, when I open the recordset.  When I create this recordset using any of the records under 128, I don&#39;t get the error.  The stored procedure returns 5 or 6 fields, one of which is the primary key called &#34;ID&#34;.  

Thanks for any help you can give me,
Andy Milk




On 2/9/99 9:40:39 PM, John wrote: 
> Hi Andy,

Define &#34;pull up a page&#34;?  You&#39;re using ASP-db to do 
> this?

What database?

Does this only happen when the key value exceeds 
> 127?

What line are you getting the error on?

Do you get this error 
> when you run pureasp.asp ?

This will help us troubleshoot with 
> you.

Thanks,
John


On 2/9/99 4:33:50 PM, Andy Milk wrote: 
> 
> I&#39;m getting this message:

Microsoft OLE DB Provider for ODBC Drivers 
> 
> error &#39;80040e21&#39; 

Errors occurred 


When I try to pull 
> up a 
> page with an primary key ID that&#39;s larger than 127.

Has 
> anyone seen 
> this problem or know what this error is?

-Andy Milk

----------


## John

Hi Andy,

As I mentioned in the first line of my reply, &#34;You&#39;re using ASP-db to do this?&#34;

This forum is dedicated to the product support of ASP-db.  There&#39;s an ASP
support forum that is frequented by the people you want to post this in
front of.  You also may get a good response in the SQL forum where they&#39;d
be more familiar with the ODBC errors.

Thanks,
John


On 2/10/99 8:16:19 AM, Andy Milk wrote: 
> 
I&#39;m sorry, I wasn&#39;t very specific about my problem.

I am using 
> ASP with SQL Server 6.5

The code that I&#39;m using is:

	SET 
> cmdProduct = 
> Server.CreateObject(&#34;ADODB.Command&#34 :Wink: 
	cmdProduct.ActiveConnection 
> = &#34;DSN=xxxx;UID=xxxx;PWD=xxxx;&#34;
	cmdProduct.CommandText = 
> &#34;qProduct&#34;
   cmdProduct.CommandType = 4
	Set prmProduct = 
> cmdProduct.CreateParameter(&#34;pProductID&#34 :Wink: 
	prmProduct.Type = 
> adTinyint
	prmProduct.Direction = adParamInput
	prmProduct.Size = 
> Len(ProductID)
	prmProduct.Value = 
> ProductID
	cmdProduct.Parameters.Append prmProduct

	Set rsProduct = 
> Server.CreateObject(&#34;ADODB.Recordset&#34 :Wink: 
        rsProduct.Open 
> cmdProduct, , adOpenKeyset, adCmdTable


I&#39;m creating a command 
> object with an ActiveConnection, adding a parameter to it, and then 
> creating a recordset with the command.

The last line of code gives me 
> the error, when I open the recordset.  When I create this recordset using 
> any of the records under 128, I don&#39;t get the error.  The stored 
> procedure returns 5 or 6 fields, one of which is the primary key called 
> &#34;ID&#34;.  

Thanks for any help you can give me,
Andy 
> Milk




On 2/9/99 9:40:39 PM, John wrote: 
> Hi Andy,

Define 
> &#34;pull up a page&#34;?  You&#39;re using ASP-db to do 
> this?

What 
> database?

Does this only happen when the key value exceeds 
> 
> 127?

What line are you getting the error on?

Do you get this error 
> 
> when you run pureasp.asp ?

This will help us troubleshoot with 
> 
> you.

Thanks,
John


On 2/9/99 4:33:50 PM, Andy Milk wrote: 
> 
> 
> I&#39;m getting this message:

Microsoft OLE DB Provider for ODBC Drivers 
> 
> 
> error &#39;80040e21&#39; 

Errors occurred 


When I try to 
> pull 
> up a 
> page with an primary key ID that&#39;s larger than 
> 127.

Has 
> anyone seen 
> this problem or know what this error 
> is?

-Andy Milk

----------


## Veena

Hi
I am getting the error called &#34;error 80040e21&#34; when i am trying to display records from DB.I have only 2 records in my database.
Coluld you please help me to correct in this

On 2/10/99 5:38:35 PM, John wrote: 
> Hi Andy,

As I mentioned in the first line of my reply, &#34;You&#39;re 
> using ASP-db to do this?&#34;

This forum is dedicated to the product 
> support of ASP-db.  There&#39;s an ASP
support forum that is frequented by 
> the people you want to post this in
front of.  You also may get a good 
> response in the SQL forum where they&#39;d
be more familiar with the ODBC 
> errors.

Thanks,
John


On 2/10/99 8:16:19 AM, Andy Milk wrote: 
> 
> 
I&#39;m sorry, I wasn&#39;t very specific about my problem.

I am using 
> 
> ASP with SQL Server 6.5

The code that I&#39;m using is:

	SET 
> 
> cmdProduct = 
> 
> Server.CreateObject(&#34;ADODB.Command&#34 :Wink: 
	cmdProduct.ActiveConnection 
> 
> = &#34;DSN=xxxx;UID=xxxx;PWD=xxxx;&#34;
	cmdProduct.CommandText = 
> 
> &#34;qProduct&#34;
   cmdProduct.CommandType = 4
	Set prmProduct = 
> 
> cmdProduct.CreateParameter(&#34;pProductID&#34 :Wink: 
	prmProduct.Type = 
> 
> adTinyint
	prmProduct.Direction = adParamInput
	prmProduct.Size = 
> 
> Len(ProductID)
	prmProduct.Value = 
> 
> ProductID
	cmdProduct.Parameters.Append prmProduct

	Set rsProduct = 
> 
> Server.CreateObject(&#34;ADODB.Recordset&#34 :Wink: 
        rsProduct.Open 
> 
> cmdProduct, , adOpenKeyset, adCmdTable


I&#39;m creating a command 
> 
> object with an ActiveConnection, adding a parameter to it, and then 
> 
> creating a recordset with the command.

The last line of code gives me 
> 
> the error, when I open the recordset.  When I create this recordset 
> using 
> any of the records under 128, I don&#39;t get the error.  The 
> stored 
> procedure returns 5 or 6 fields, one of which is the primary key 
> called 
> &#34;ID&#34;.  

Thanks for any help you can give me,
Andy 
> 
> Milk




On 2/9/99 9:40:39 PM, John wrote: 
> Hi Andy,

Define 
> 
> &#34;pull up a page&#34;?  You&#39;re using ASP-db to do 
> 
> this?

What 
> database?

Does this only happen when the key value 
> exceeds 
> 
> 127?

What line are you getting the error on?

Do you 
> get this error 
> 
> when you run pureasp.asp ?

This will help us 
> troubleshoot with 
> 
> you.

Thanks,
John


On 2/9/99 4:33:50 PM, 
> Andy Milk wrote: 
> 
> 
> I&#39;m getting this message:

Microsoft OLE 
> DB Provider for ODBC Drivers 
> 
> 
> error &#39;80040e21&#39; 
> 

Errors occurred 


When I try to 
> pull 
> up a 
> page with an 
> primary key ID that&#39;s larger than 
> 127.

Has 
> anyone seen 
> 
> this problem or know what this error 
> is?

-Andy Milk

----------

