VB Migration Partner - Knowledge Base - The Execute Method of the ADODB

Embed Size (px)

Citation preview

  • 7/22/2019 VB Migration Partner - Knowledge Base - The Execute Method of the ADODB

    1/1

    Home VB Migration Partner Resources Migration services FAQ Blog Contact us

    VB Migration Partner

    KNOWLEDGE BASE - Database and data-binding

    Previous | Index | Next

    [PRB] The Execute method of the ADODB.Connection object can create a spurious Recordsetobject

    COM Interop has a weird and interesting bug might manifests itself when migrating calls to the Execute method of the

    ADODB.Connection object:

    ' open an ADODB connection and then a recordset

    Dim cn As New ADODB.Connection

    cn.Open(myConnectionString)

    cn.BeginTrans()

    Dim rs As New ADODB.Recordset

    rs.Open("SELECT * FROM Products", cn, ADODB.CursorTypeEnum.adOpenKeyset)

    ' insert a new record

    cn.Execute("INSERT Orders (OrderId) VALUES (1234)") '