Avoiding "Current provider does not support the necessary interface for Index functionality" exception
In an application migrated from D7 & IP 4000.0.2 to D11 & 22.1.0.9, the app throws the exception when I drop down or begin typing in a TwwDBLookupCombo control.
The relevant code has changed significantly. 22.1.0.9 has code to determine whether to call wwSetTableIndex based on the class of the lookup table and whether the table is using a client side cursor. After searching online, my understanding is that the MSSQL providers for ADO do not support setting an index in this manner.
I also tested outside of any InfoPower code, trying various cursor location and cursor type values. Fortunately, ADO (and dbGO) do provide a way of determining which cursor options are available. I modified my copy of vcl.Wwcommon.pas to do this at the top of wwSetTableIndex:
if wwIsClass(DataSet.ClassType, 'TCustomADODataSet') and
not TCustomADODataSet(DataSet).Supports([coIndex]) then
Exit;
This may not be the best solution. But it avoids an exception occurring and adding code to eat the exception, since there is nothing the user can do about it.
Please sign in to leave a comment.
Comments
0 comments