dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Recordsets - Multiple-step operation generated errors - HELP....

  1. #1
    Join Date
    Jan 2008
    Posts
    7

    Talking Recordsets - Multiple-step operation generated errors - HELP....

    i'm supporting legacy vb 6.0 code in business tier. Recordset rsRealtimeBalances updates recordset rsData and then the recordset is passed to the UI.

    Migrating from sql 2000 to sql 2005 broke the code. i need help converting the following code. thanks

    CODE EXAMPLE:
    Dim rsData As ADODB.Recordset
    Dim rsRealtimeBalancesAs ADODB.Recordset

    Set rsData = m_objDS.ExecSP("abcd", "stored procedure", arrParams)

    If Not (rsData.EOF And rsData.BOF) Then

    '// Fetch the balances for the Shares
    rsData.Filter = "cert_note_no = NULL"

    If (m_objDS.SelectDataRealtime("another datasource", sql string, rsRealtimeBalances)) Then

    While Not rsData.EOF

    rsRealtimeBalances.Filter = strACNFilter & " AND " & strShareSuffixFilter

    '// Make sure there is something there!
    If Not (rsRealtimeBalances.EOF) Then
    ***this step is erroring on me.....
    ***--Multiple-step operation generated errors--*** when the next line of code executes
    rsData!Bal = rsRealtimeBalances!Bal
    End If

    rsData.MoveNext
    Wend
    '// Reset to the first record
    rsData.Filter = ""
    rsData.MoveFirst
    End If
    Last edited by ckruelle; 02-29-2008 at 03:57 PM.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    ***this step is erroring on me.....
    rsData!Bal = rsRealtimeBalances!Bal
    What is the error message? What are the data types of the two Bal columns?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX
    Quote Originally Posted by ckruelle
    Migrating from sql 2000 to sql 2005 broke the code.
    What, specifically, and in details, does this mean?

  4. #4
    Join Date
    Jan 2008
    Posts
    7

    Talking thanks for the replies

    1. the error that i'm receiving is "multi-step operation generated error" when i debug the step where i said i'm receiving an error.

    rsData!AVL_BAL = rsRealtimeBalances!AVL_BAL

    2. both data types are of datatype "long"
    i'm taking the realtime balance of (made up amount) 326.50 and trying to assign it to rsData!AVL_BAL.

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Try it with a whole number. Longs don't like decimals.

  6. #6
    Join Date
    Jan 2008
    Posts
    7

    Unhappy matching datatypes - thanks for the help

    first, i provided the wrong fields above, those are additional lines that appear below this line: (so i figure once i figure this line out, i will be able to update the other lines ...) sorry about the confusion.

    rsData!Bal = rsRealtimeBalances!Bal

    i set the following so the datatypes match up in the recordset, but still receive the following error:

    rsData!Bal = CCur(rsRealtimeBalances!Bal)

    "Multiple-step operation generated errors. Check each status value."

  7. #7
    Join Date
    Jan 2008
    Posts
    7

    Cool still no luck



    the rsRealTimeBalance recordset field type for "Bal" is Numeric (15,2),
    so in the s.p. in SQL 2005 i added the following:

    CAST(BAL AS NUMERIC(15,2)) AS BAL,

    so rsData recordset field type would be of the same datatype. no luck.
    still receiving "Multiple-step operation generated errors. Check each status value."

    rsData recordset is in the "open" state when i try to assign a value to the field. i even try to just save the value 0 (zero) to the recordset field and it gives the same error.

    i tried to google for difference for recordset updating for sql 2000 and sql 2005 and could not find anything. when i compare the recordset properties between sql 2000 and sql 2005 they are the same. so i'm stumped.

    Any help would be greatly appreciated.

  8. #8
    Join Date
    Jan 2008
    Posts
    7

    Cool still looking for help (2/29/2008)



    here is the error i'm getting from the 2 records sets

    ***--Multiple-step operation generated errors--***

    rsData retrieves data from sql 2005
    rsRealtimeBalance retrieves data from an ODBC connection

    i have match up the data types with no luck.

  9. #9
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Generally, this error indicates that a field is getting invalid
    data, such as an incorrect data type. Without knowing the structure of your data and the queries you're using to populate the recordsets, there's not much else we can do to help you.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  10. #10
    Join Date
    Jan 2008
    Posts
    7

    Talking more info....

    SQL 2005 recordset information
    '//Setup Recordset
    Dim rsData As ADODB.Recordset
    Set rsData = New ADODB.Recordset

    rsData.Open cmdSP, , adOpenStatic, adLockBatchOptimistic

    Set rsData.ActiveConnection = Nothing

    '//Run stored procedure
    Set ExecSP = rsData


    SQL 2005 stored procedure tsql code


    SELECT AVL_BAL,
    BAL,


    FROM abc SA
    WHERE ...

    sql 2005 field and datatypes
    1 bal money 8 1
    0 avl_bal money 8 1


    ****************************************************************************************** **************************

    ODBC connection information

    'set some connection preferences
    '// adUseServer -- ADO client-side cursors do not perform aggregate function properly
    '// you MUST use the ODBC provided cursor engine.
    objConnection.CursorLocation = adUseServer
    objConnection.CommandTimeout = kTimeOut

    rsData.MaxRecords = lngMaxRecords

    'retrieve our data
    rsRealTimeData.Open strSQL, objConnection, adOpenKeyset, adLockBatchOptimistic, adCmdText

    '// Copy the Recordset to a disconnected client-side recordset
    '// (the Recordset.Clone method is unavailable for DataSafe recordsets)
    If Not (ConvertToClientCursor(rsRealTimeData, rsData)) Then Err.Raise -2147467259


    ODBC connection - sql stmt

    SELECT acn, sh_sfx, bal, avl_bal
    FROM abc
    WHERE ...


    ODBC field and datatypes
    Bal - adNumeric - length=0 - precision=15
    avl_Bal - adNumeric - length=0 - precision=15


    the Visual Basic 6 code

    'i also tried just assigning number to it below and still received same "multiple-step operation" error.
    If Not (rsRealtimeBalances.EOF) Then
    'rsData!BAL = rsRealtimeBalances!BAL
    rsData!Bal = 2500

    End If

    if Not (rsRealtimeBalances.EOF) Then
    rsData!AVL_BAL = rsRealtimeBalances!AVL_BAL
    End If

    i have also tried changing the SQL 2005 datatype to numeric but still got the same error.

    thanks for your help. i appreciate it!!
    Last edited by ckruelle; 03-04-2008 at 08:10 AM.

  11. #11
    Join Date
    Jan 2008
    Posts
    7

    Thumbs up solution was found



    i was reviewing this post:
    http://www.developersdex.com/sql/mes...4737805&page=2


    and found this reply:

    > I've been debugging and looking to isolate the problem to be able to
    > present a reproducable case:
    >
    > Now, at last, I have isolated the problem and wasn't the SHAPE command
    > that raised the error, but a UNION SELECT in a query of one of my
    > subrecordsets.

    The underlying problem is that SQL 2005 does not return metadata for
    the underlying table. That makes ADO think that the column is not
    updateable. (Which, if you ask me, is a completely stupid idea.)

    The workaround I can think of is to bounce data over a temp table.

    *****************************************
    i reviewed the stored procedure and sure enough there was a UNION stmt. I created a temp table and stored the SELECT stmt with the UNION into the temp table. When i went back to execute my COM object, and itworked!!

    Thanks for everyone's help.
    Chuck

Similar Threads

  1. Multiple step operation generated errors.
    By RipIT in forum VB Classic
    Replies: 5
    Last Post: 05-01-2007, 06:26 PM
  2. Multiple-step operation generated errors.
    By rdwagco2 in forum Database
    Replies: 1
    Last Post: 08-04-2005, 09:38 AM
  3. Replies: 1
    Last Post: 05-29-2002, 04:16 PM
  4. Multiple step operation generated errors
    By John Wood in forum VB Classic
    Replies: 5
    Last Post: 12-06-2001, 08:53 PM
  5. Multiple-step operation generated errors
    By Rahul in forum VB Classic
    Replies: 1
    Last Post: 10-15-2001, 03:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center