Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3668738
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:09:31+00:00 2026-05-19T02:09:31+00:00

I have a routine which reads one recordset, and adds/updates rows in a similar

  • 0

I have a routine which reads one recordset, and adds/updates rows in a similar recordset. The routine starts off by copying the columns to a new recordset:

Here’s the code for creating the new recordset..

For X = 1 To aRS.Fields.Count
    mRS.Fields.Append aRS.Fields(X - 1).Name, aRS.Fields(X - 1).Type, aRS.Fields(X - _
          1).DefinedSize, aRS.Fields(X - 1).Attributes
Next X

Pretty straight forward. Notice the copying of the name, Type, DefinedSize & Attributes…

Further down in the code, (and there’s nothing that modifies any of the columns between.. ) I’m copying the values of a row to a row in the new recordset as such:

 For C = 1 To aRS.Fields.Count
     mRS.Fields(C - 1) = aRS.Fields(C - 1)
 Next C

When it gets to the last column which is a numeric, it craps with the “Mutliple-Step Operation Generated an error” message.

I know that MS says this is an error generated by the provider, which in this case is ADO 2.8. There is no open connect to the DB at this point in time either.

I’m pulling what little hair I have left over this one… (and I don’t really care at this point that the column index is ‘X’ in one loop & ‘C’ in the other… I’ll change it later when I get the real problem fixed…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:09:32+00:00Added an answer on May 19, 2026 at 2:09 am

    You have to set Precision and NumericScale for adDecimal and adNumeric fields before opening synthetic recordset like this

    For X = 1 To aRS.Fields.Count
        With aRS.Fields(X - 1)
            Select Case .Type
            Case adChar, adWChar, adBinary, _
                    adVarChar, adVarWChar, adVarBinary, _
                    adLongVarChar, adLongVarWChar, adLongVarBinary
                mRS.Fields.Append .Name, .Type, .DefinedSize, .Attributes
            Case adDecimal, adNumeric
                mRS.Fields.Append .Name, .Type, , .Attributes
                mRS.Fields(mRS.Fields.Count - 1).Precision = .Precision
                mRS.Fields(mRS.Fields.Count - 1).NumericScale = .NumericScale
            Case Else
                mRS.Fields.Append .Name, .Type, , .Attributes
            End Select
        End With
    Next
    

    FYI: you might be get a recordset with a field that has no name from the database e.g.

    SELECT 5, 'No name'
    

    but ADO will not allow an empty name on Append method. You might also get a recordset with duplicate fields from the database e.g.

    SELECT 5 AS Col, 'Second' AS Col
    

    which in your case will bomb out on Append too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a routine which is updating my business entity. The update involves about
I have a routine which uses a recursive loop to insert items into a
I have active_record setup to use a Postgresql database. One of the columns is
I have a FindFile routine in my program which will list files, but if
I have a tun/tap device which is used to read incoming packets from one
I have one .key file from which I generated a .csr file that I
I have some code which iteratively appends data to a file and looks similar
Does libjpeg allows/have routines to scale the output image? I have an image which
I have a class which is routing many messages into inner component instance. So
I used to use Backbone.js as an easy MVC framework which have build-in routing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.