RDO Problem when rolling back transaction - Function sequence error 
Author Message
 RDO Problem when rolling back transaction - Function sequence error


I am getting the following error message when I try and rollback a
transaction within an rdoConnection:

        40002:S1010:[Microsoft]:[ODBC SQL?Server Driver]:Function sequence error

The transaction is getting rolled back no problem but I get the annoying
error message and then the function terminates. Below is a listing of the
code that is causing the problem. Any advice appreciated.

Other Details:

        SQLSRV32.dll Version 2.65.0201
        VB4.0a Enterprise Edition
        WinNT 4.0

James Eyre
(VBA Software Pty Ltd

Function AddSpec(cnSQL as rdoConnection) as long

    Dim bInTrans As Boolean
    Dim lNewSpec As Long
    Dim iParts As Integer

    On Error GoTo Err_AddSpec
    bInTrans = False

    AddSpec = 0
    If ValidDetails Then
            bInTrans = True
            'Add the spec to the tblParts table
            Set rdoPS = cnSQL.rdoPreparedStatements!AddSpec
            With rdoPS
                .rdoParameters(0).Direction = rdParamOutput
                .rdoParameters(1) = specNum
                .rdoParameters(2) = specDesc
                .rdoParameters(3) = specType
                If specLocation = 0 Then
                    .rdoParameters(4) = Null
                    .rdoParameters(4) = specLocation
                End If
                .rdoParameters(5) = specClass
                .rdoParameters(6) = cvSuppId
            End With

            lNewSpec = rdoPS.rdoParameters(0)

            'Add the spec details to the tblSpecDetails table
            Set rdoPS = cnSQL.rdoPreparedStatements!AddSpecDets

            With rdoPS
                .rdoParameters(0) = lNewSpec
                .rdoParameters(1) = specCust
                .rdoParameters(2) = specSoftware
                .rdoParameters(3) = specDets
                .rdoParameters(4) = specDesc
            End With

            'Add the spec parts to the tblSpecParts table
            Set rdoPS = cnSQL.rdoPreparedStatements!AddSpecParts
            For iParts = 1 To specParts.Count

                With rdoPS
                    .rdoParameters(0) = lNewSpec
                    .rdoParameters(1) = specParts(iParts).prtId
                    .rdoParameters(2) = specParts(iParts).prtQty
                End With
            Next iParts
                Goto Err_AddSpec <= To force the operation to Rollback
        AddSpec = lNewSpec
        bInTrans = False

    End If


    Exit Function


    On Error GoTo 0
    If bInTrans = True Then
        cnSQL.RollbackTrans => This causes the error message listed above
                                and exits the function
    End If

    Err.Raise vbObjectError + 1003
    Resume Exit_AddSpec

End Function

Sat, 01 May 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Roll back transaction Error handling

2. Rolling back transactions

3. COM+ question: SetAbort not rolling back transaction?

4. MTS, VB and rolling back transactions

5. SetAbort does not roll back transaction

6. RDO Transaction Problem

7. Problems with transactions with RDO/SQLserver

8. RDO transaction problem ??

9. RDO 2.0 Transactions property problem

10. Absolute Position and Function Sequence Error

11. Function Sequence Error

12. Function Sequence Error using ODBC ->SQL


Powered by phpBB® Forum Software