ADO: Determine open transaction + DED command ignors Locktype, CursorType and CursorLocation 
Author Message
 ADO: Determine open transaction + DED command ignors Locktype, CursorType and CursorLocation

Hello all,

I have the following centralized database execution procedure.

Public Sub ExecuteDbCommand(strcmdName As String, _
                           dictParam As Scripting.Dictionary, _
                           rs As ADODB.Recordset, _
                           Optional bdml As Boolean = False)
    Const G_PROCEDURENAME As String = "ExecuteDbCommand"
    Dim key As Variant
    Dim comm As New ADODB.Command

    On Error GoTo ecError

    Set comm = de.Commands(strcmdName)
    ' Fill the parameters
    For Each key In dictParam
        comm.Parameters.Item(key).Value = dictParam(key)
    Next

    If Not bdml = True Then
        Set rs = comm.Execute()
    Else
        comm.Execute
    End If

    Exit Sub
ecError:
    Dim strErrorStart As String
    Dim strErrorEnd As String

     ' How many transactions are open?
    ' I use a global boolean btrans to signal that there is an open
transaction
    ' So far: no nested transactions ##########################
    If btrans = True Then
        de.cn.RollbackTrans
        btrans = False
    End If
    '#######################################
    strErrorStart = LoadResString(IDS_MSG_EXECUTEDBCOMMAND) & vbCrLf
    strErrorEnd = WriteProcedureInfo(G_MODULENAME, G_PROCEDURENAME,
strcmdName)
    GlobalError IDS_ERR_EXECUTEDBCOMMAND, strErrorStart, strErrorEnd
End Sub

The de variable is the current DataEnvironment.
Is there a chance to determine the number of open transactions?

Another question: I use the DataEnvironment-Designer. In the returned
recordset 'rs' the Properties
CursorLocation = adUseClient
CursorType = adOpenStatic
LockType = adLockReadOnly
are always set to same values. If I change the properties in the appropriate
rsCOMMANDNAME to CursorLocation = adUseServer, CursorType = adOpenKeyset and
LockType = adLockOptimistic in the DED dialog the result recordset doesn't
change. Whats wrong? Isn't it possible to use the command-object with
specific Cursor type and lock types.
If I execute the command 'comm' with rs.open comm .....  then everything
went fine.

Thanks in advance
    Alfred



Sun, 14 Mar 2004 05:54:45 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ADO CursorType & LockType analysis

2. CursorType and LockType reset!

3. CursorType and LockType declaration question

4. LockType decide CursorType?

5. LockType and CursorType from Execute Method

6. LockType and CursorType

7. Help! ADO command - CursorType

8. Determining open transaction

9. IE6 Ignors Navigate Command

10. Determine if a ADO-Connection is in a Transaction

11. Any ADO Connection Property to check if A transaction is Open

12. DED, The Greatful DED

 

 
Powered by phpBB® Forum Software