ADO adNumeric Error

Posted on 2003-02-27
Medium Priority
Last Modified: 2008-03-10
The code

    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.Fields.Append "test1", adNumeric
    rs(0).Value = 1

On the line that sets the value for the field I get the error :  "Multiple-step operation generated errors. Check each status value."

I am using ADO 2.7.

This snippet is part of a larger project, and I DO NOT have the ability to change to one of the other datatypes such as adCurrency.  

Any suggestions on how to stop the error would be greatly appreciated.  

- Jeremy
Question by:thedude__
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 44

Expert Comment

ID: 8034966
since you have created what appears to be a disconnected recordset, what are you trying to UPDATE.  Update serves to post the recordset BACK to the underlying Table in the connected database.  Since you don't have an underlying table, where is the UPDATE supposed to go?


Author Comment

ID: 8035017
Great question.  

As you pointed out, the recordset does post the changes back to a table in the database.  This is true if you are actually connected to a database.  

If you are not connected to the database the update will update the local memory resident disconnected recordset.

My error actually occurs in the "rs(0).Value = 1" statement.  For some reason I am unable to update the Numeric type of field.


Accepted Solution

NPluis earned 200 total points
ID: 8035632
You should set the NumericScale and Precision for the field after you add it:

rs.Fields.Append "test1", adNumeric
   rs(0).NumericScale = 10
   rs(0).Precision = 28

This should work for your example.
See the ado help file or Microsoft site for more info for NumericScale and Precision

Author Comment

ID: 8035762
Awesome, thanks.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question