Microsoft KB Archive/305463

= FIX: Error &quot;Wrong Number of Arguments or Invalid Property Assignment: 'Item'&quot; When You Set Field Value in ASP Using ADO 2.5 =

Article ID: 305463

Article Last Modified on 5/17/2007

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.5

-



This article was previously published under Q305463



SYMPTOMS
When you try to update a field in an ADO recordset in Microsoft Active Server Pages (ASP), the following error may occur on a line that assigns a value to a field:

Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'Item'



CAUSE
This error occurs when you use the following syntax to assign a value to a field: rs.Fields.Item(&quot;LName&quot;) = &quot;Smith&quot; This syntax does not specify the Value property, which is the default property. Although it not necessary to specify the Value property in ADO 2.1 and earlier, the absence of the Value property in ADO 2.5 causes the above-mentioned error message.



RESOLUTION
To resolve this problem, download Microsoft Data Access Components (MDAC) version 2.6 or later. You can obtain the latest version of MDAC from the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/data/aa937695.aspx

To work around this problem, use one of the following methods:   Specify the Value property explicitly, for example: rs.Fields.item(&quot;LName&quot;).value = &quot;Smith&quot;   Avoid using the Item object, for example: rs.Fields(&quot;Lname&quot;) = &quot;Smith&quot; 



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in MDAC 2.6 or later.

Additional query words: 800a01c2

Keywords: kbbug kbfix KB305463

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.