Results 1 to 16 of 16

Thread: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

  1. #1

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Resolved [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    Latest Windows 10 Update KB4015217 breaks ADODB.Recordset Filter property when using array of bookmarks.

    Here is repro
    Code:
    Option Explicit
    
    Private Sub Form_Load()
        Const adInteger As Long = 3
        Dim rs          As Object
        
        Set rs = CreateObject("ADODB.Recordset")
        rs.Fields.Append "ID", adInteger
        rs.Open
        rs.AddNew "ID", 1
        rs.AddNew "ID", 2
        rs.MoveFirst
        rs.Filter = Array(rs.Bookmark)
    End Sub
    Last line causes Access Violation when using early bound calls and renders most of our applications unusable.

    The equivalent KB4015549 (Monthly Rollup) patch for Windows 7 breaks client-side cursor library in similar manner.

    The offending version of C:\Program Files (x86)\Common Files\System\ado\msado15.dll is 10.0.14393.1066

    cheers,
    </wqw>

  2. #2
    New Member
    Join Date
    Apr 2017
    Posts
    1

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    I'm having this exact problem starting today as well, but I'm accessing the ancient adodb.dll version 7.10.2346 from C# in VS 2013 (a COM interface from VB6 is involved, too). I have no idea how to start fixing this. "Embed interop types" is set to false for the reference, so I'm starting with turning that on. Have you discovered anything yet?

  3. #3

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    We just removed the cumulative update (refusing supporting it) and are waiting for a fix from MS now. A simple workaround that worked in our particular case was to replace the array of bookmarks with ID=x OR ID=y OR ID=z but we almost always do have ID field in our recordsets.

    Unfortunately this is not 1:1 replacement for the bookmarks array filter as when you filter on Array(8, 3, 5) you get the recordset in exactly the same order (8th row, then 3rd row, then 5th) while with `ID=x OR y OR z` the original order is kept no matter the order x, y or z in the filter.

    cheers,
    </wqw>

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    We saw it with early-bound Recordsets as well. Users were reporting "program just blows up" but this is exactly what is going on.

    On Windows 10 Pro you can uninstall the patch and then run the wushowhide.diagcab from:

    How to temporarily prevent a driver update from reinstalling in Windows 10.

    This isn't just for driver updates as the name suggests.

    Win10 Home users have little option but to set their Internet network adapter to "metered connection" to stave off updates until this is resolved.

  5. #5

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    Setting `Filter` property late-bound converts AV to a trappable `Method 'Filter' of object '_Recordset' failed` error as VB installs custom SEH during late-bound calls for this exact purpose but at this point the Recordset object internals are messed up and in the error handler it's not possible to access `Filter` property -- it just AVs again.

    Here is my attempted (not working) work-around:
    Code:
    Public Function SetRecordsetFilter(rs As Recordset, vFilter As Variant) As Recordset
        Const FUNC_NAME     As String = "SetRecordsetFilter"
        Dim oObj            As Object
        
        On Error GoTo EH
        If Not IsArray(vFilter) Then
            rs.Filter = vFilter
        Else
            rs.Filter = adFilterNone
            Set oObj = rs
            On Error GoTo EH_Filter
            Debug.Print 1 / 0
            oObj.Filter = vFilter
    AfterFilter:
            On Error GoTo EH
        End If
        Set SetRecordsetFilter = rs
        Exit Function
    EH:
        If RaiseError(FUNC_NAME & "(vFilter=" & DumpParam(vFilter) & ")") = vbRetry Then
            Resume
        End If
    EH_Filter:
        Dim oFld            As ADODB.Field
        Dim cBuilder        As Collection
        Dim vBmk            As Variant
        Dim sFilter         As String
    
        Set oFld = rs!ID
        Set cBuilder = New Collection
        For Each vBmk In vFilter
            If SetBookmark(rs, vBmk) Then
                cBuilder.Add "ID=" & oFld.Value
            End If
        Next
        sFilter = ConcatCollection(cBuilder, " OR ")
        If LenB(sFilter) <> 0 Then
            rs.Filter = sFilter  '<-- at this point Recordset is messed up beyond repair and blows up again
        Else
            rs.Filter = EmptyVariantArray
        End If
        Resume AfterFilter
    End Function
    cheers,
    </wqw>
    Last edited by wqweto; Apr 13th, 2017 at 04:11 AM.

  6. #6
    Frenzied Member
    Join Date
    May 2014
    Location
    Central Europe
    Posts
    1,372

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    Its a shame how MS deals with legacy components nowadays. i have seen several updates affecting especially common controls library in the past few years and it seems that they do not really care about this or even want to push developers away from the these old technics.
    does not help, i know, but i just wanted to say i find it a disgrace for MS.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    April 2017 Monthly Rollup Breaks VB6 App mentions Win7 and Win8.1 as well as Win10.

    It has a link back to this thread.

  8. #8

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    Reversing `Filter` property I just found out that one can use byte-arrays for bookmarks -- this is not documented as far as I can google it. Something like `Redim baBmk(0 to 3) As Byte` is a valid bookmark and can be assigned to `Filter` for a single-record view of the recordset. So using `Array(baBmk1, baBmk2, ...)` is also valid but does not solve the problem w/ KB4015217 (AV in `ExtractArray` function which does not check a NULL pointer in last argument, passed by `ExtractBookmarksArray` where the actual bug is).

    The workaround I'm currently deploying is by using activation context to force usage of previous version of msado15.dll like this
    Code:
        With CreateObject("Microsoft.Windows.ActCtx")
            .Manifest = App.Path & "\support\msado15.dll.manifest"
            Set rs = .CreateObject("ADODB.Recordset")
        End With
    . . . where the msado15.dll.manifest is created either by UMMM or DLLAsm.

    There are a couple of quirks in this workaround mode: First, rs.NextRecordset creates an ADODB.Recordset from the system registered coclass (so don't filter these!) and second, cloning a recordset with PropertyBag (.WriteProperty and then Set rs = .ReadProperty("rs")) also might "escape" the activation context.

    For the second case I just create a recordset from ActCtx and then `rs.Open .ReadProperty("rs")` to "clone" the data.

    cheers,
    </wqw>

  9. #9

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: FYI: KB4015217 breaks ADODB.Recordset Filter property

    FYI, just got restarted by windows update and this bug seems to be sorted out. On my machine msado15.dll version is 10.0.14393.1198 w/ last modified date 28th April, 2017

    cheers,
    </wqw>

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    Are you saying the Patch Tuesday burden had a fix for this?

    Did you have to unblock the previous patch that broke it? If not, have you done it anyway?

    I've been wondering whether or not having that patch from last month blocked has been blocking the 1703 "Creators Update" or if I'm just low on the totem pole to get it. I'm not in a rush, just tired of waiting for the other shoe to drop.

  11. #11

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    I did not block previous April patch as I've been using manifested ADO on dev machine (in VBIDE) and in production. I didn't get Creators Update too probably because I'm using Win10 *Enterprise* edition, I'm not sure if this update will ever shine on enterprise users at all.

    I'll surely be waiting for at least 30-60 days before removing manifest workaround from deployment for this update to go through update channels for Win7, Win8, etc. OSes I'm supporting.

    cheers,
    </wqw>

  12. #12
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    I doubt the edition of Windows has much bearing on this aside from perhaps greater ease in stalling such updates for a longer period.

    "Creators Update" is just a marketing label. This is just the next major update in the rolling update life of Windows 10. Resistance is futile.

    At least some of the things in 1703 sound like they fix real issues. These are things I can't imagine an enterprise customer wanting to do without. The DPI handling improvements alone might save a good deal in LOB app redevelopment effort that won't need to be undertaken now or done for new code in the future.

  13. #13

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    Ahaa, so it's just a fancy name for the next service pack. I thought it was somehow connected to the round dial device they showed for color picking for professional tablet user (painters, CAM/CAM, whatever). Now I understand, so we'll just sit and wait then.

    Anyway, the newest Windows on ARM64 project looks interesting. Full x86 (but not x64) emulation it seems. The mythical VB vNext project will now have to seriously consider native ARM targets IMHO :-))

    cheers,
    </wqw>

  14. #14
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    I'm not holding my breath.

    That x86 emulation seems to come with so many strings attached (e.g. Store deployment only, Centennial [now Desktop Bridge] packaging mandatory) that for most developers it may as well not exist.

    But as I said 5 months ago when this first came up, only time will tell.

  15. #15

    Thread Starter
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    In the demo above they just downloaded 7-zip setup, installed it and run it's GUI file manager. Seems like emulation is working transparently and will probably run VB6 apps w/ no source code modifications.

    cheers,
    </wqw>

  16. #16
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: [RESOLVED] FYI: KB4015217 breaks ADODB.Recordset Filter property

    Cool. Sounds different from what they talked about last December.

    So what they showed at your link above looks the same as running x86 on x64, aside from the performance penalty of a software x86 emulation running on ARM64. Turns into a non-issue for the most part.

    What they didn't discuss relates to your point about targeting ARM64 with a new compiler. That makes me wonder what if anything changes about the programming model for a native ARM64 program vs. x86 and x64 programs, what replaces Win32 if anything, etc.
    Last edited by dilettante; May 11th, 2017 at 10:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width