Multiple-step operation generated errors 
Author Message
 Multiple-step operation generated errors

'I am trying to write a record from a text file "data.doc'
to a database
'table. But its generating an error ...
'Run-time error '-2147217887(80040e21)':
'Multiple-step operation generated errors. Chech each
status value.

Dim udtRecord As bt_grn
Public lFilePos As Long
Private Type bt_grn
    GR_RISK As String
    BKG_STN As String
    GR_DATE As Integer
End Type
Private Sub cmdImport_Click()

    Open App.Path & "\data.doc" For Binary As #1
    'initialize to starting position
    lFilePos = 1

        'Adodc1.Recordset.AddNew
        'Adodc1.Recordset.Fields(0) = "e111"
        'Adodc1.Recordset.Fields(1) = "testing"
        'Adodc1.Recordset.Fields(2) = "test"
        'Adodc1.Recordset.UpdateBatch adAffectAll

        'The above code in comments is working fine as a
static record.
        'But the code below written in LOOP is generating
an error.
        'Run-time error '-2147217887(80040e21)':
        'Multiple-step operation generated errors. Chech
each status value.

    Do
        Get #1, lFilePos, udtRecord
        If LOF(1) = 0 Then Exit Do

        Adodc1.Recordset.AddNew
        Adodc1.Recordset.Fields(0) = udtRecord.BKG_STN
        Adodc1.Recordset.Fields(1) = udtRecord.GR_DATE
        Adodc1.Recordset.Fields(2) = udtRecord.GR_RISK
        Adodc1.Recordset.UpdateBatch adAffectAll
        Adodc1.Recordset.Bookmark =
Adodc1.Recordset.Bookmark

        'get file postion for next record
        lFilePos = Seek(1)
    Loop Until lFilePos >= LOF(1)

    Adodc1.Refresh
    Close #1
End Sub

'Please Help me



Wed, 31 Mar 2004 04:27:31 GMT  
 Multiple-step operation generated errors
Hi Rahul,

The error message may occur when the data type is not compatible between
the database structure and inserted data. If you can successfully add the
static value into database, you can narrow down the problem by monitoring
the data read from the data.doc when debugging.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copy Right, 2001 Microsoft Corporation. All rights reserved.

Regards,
Kally Wang
Microsoft Support Engineer

==Original Message==


Subject: Multiple-step operation generated errors
Date: Fri, 12 Oct 2001 13:27:31 -0700
Newsgroups: microsoft.public.vb.database

'I am trying to write a record from a text file "data.doc'
to a database
'table. But its generating an error ...
'Run-time error '-2147217887(80040e21)':
'Multiple-step operation generated errors. Chech each
status value.

Dim udtRecord As bt_grn
Public lFilePos As Long
Private Type bt_grn
    GR_RISK As String
    BKG_STN As String
    GR_DATE As Integer
End Type
Private Sub cmdImport_Click()

    Open App.Path & "\data.doc" For Binary As #1
    'initialize to starting position
    lFilePos = 1

        'Adodc1.Recordset.AddNew
        'Adodc1.Recordset.Fields(0) = "e111"
        'Adodc1.Recordset.Fields(1) = "testing"
        'Adodc1.Recordset.Fields(2) = "test"
        'Adodc1.Recordset.UpdateBatch adAffectAll

        'The above code in comments is working fine as a
static record.
        'But the code below written in LOOP is generating
an error.
        'Run-time error '-2147217887(80040e21)':
        'Multiple-step operation generated errors. Chech  each status
value.

    Do
        Get #1, lFilePos, udtRecord
        If LOF(1) = 0 Then Exit Do

        Adodc1.Recordset.AddNew
        Adodc1.Recordset.Fields(0) = udtRecord.BKG_STN
        Adodc1.Recordset.Fields(1) = udtRecord.GR_DATE
        Adodc1.Recordset.Fields(2) = udtRecord.GR_RISK
        Adodc1.Recordset.UpdateBatch adAffectAll
        Adodc1.Recordset.Bookmark =
Adodc1.Recordset.Bookmark

        'get file postion for next record
        lFilePos = Seek(1)
    Loop Until lFilePos >= LOF(1)

    Adodc1.Refresh
    Close #1
End Sub

'Please Help me



Fri, 09 Apr 2004 20:53:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Multiple-step operation generated errors. (Delete Error)

2. Multiple-step operation generated errors

3. DataGrid Warning - Multiple-step operation generated errors......

4. multiple-step operation generated errors

5. How to locate Multiple-step operation generated errors.

6. Multiple-step operation generated errors

7. Multiple-step operation generated errors

8. Error: Multiple step OLE DB operation generated errors

9. Error: Multiple-step OLE DB operation generated errors

10. FileSystemObject.FileCopy Multiple-step OLE DB operation generated errors

11. Multiple-step OLE DB operation generated errors

12. Multiple-step OLE DB Operation Generated Errors

 

 
Powered by phpBB® Forum Software