Visual Basic Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for June, 2010

BUG: DataGrid Does Not Handle Special Filter Constants Correctly

Symptoms
When the filter of an ADO Recordset object is set to one of the special constants, such as adFilterPendingRecords, the bound DataGrid control still displays all of the rows in the Recordset. If the filter is set to specify a particularfield, such as “State = ‘CA’,” the DataGrid displays only the rows that are specific to that filter.
Resolution
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

BUG: DataCombo/DataList Not Displaying Recordset with Sort/Filter

Symptoms
DataCombo/DataList controls bound to an ADO.Recordset are not correctly reflecting data when Recordset.Sort or Recordset.Filter is applied.
Resolution
The DataCombo/DataList controls don’t use chapter handles when fetching rows from OLEDB rowsets. They do call IRowPosition::GetRowPosition and pass in a non-NULL chapter handle parameter, but apparently they don’t use it. As a result, these controls behave incorrectly when bound to child commands from the DE (or manually to child recordsets) or when the Sort and Filter properties on the recordset are modified after binding to these controls. In certain cases, this results in run-time errors and, in other cases, the controls are populated with the entire rowset rather than the restricted set of rows. The Hierarchical Flex grid control appears to work properly. The DataList and DataCombo controls are OLEDB bindable controls, but they do not utilize chapter handles.

BUG: Data Report Not Always in WindowList

Symptoms
An MDIFORM does not show the child form in the WindowList menu if the childform is a Data Report. If the Data Report is minimized and then returned toa normal state, it will show up in the WindowList.
Resolution
To work around this problem, add code to your program that minimizes thereport prior to opening the report in normal mode. Refer to the Steps toReproduce Behavior section of this article for sample code on thisworkaround.

BUG: Data Form Wizard Mishandles ‘-’ in Table or Field Names

Symptoms
When loading a form created by the Data Form Wizard, you may receive one ofthe following error messages:

Run-time error ‘-214217900 (80040e14)’, “Syntax error in FROM clause”
-or-

Run-time error ‘-214217904 (80040e10)’, “No value given for one or morerequired parameters”
Resolution
If the data source for a form created by the Data Form Wizard containsa dash ‘-’ in its name or in the name of a field, it is required that thedata source name or field name be delimited by brackets in a SQL statement.The Data Form Wizard does not include brackets around these names.

BUG: Data Environment: MSHFlexGrid Rebinding Data

Symptoms
Attempting to rebind the MSHFlexGrid to a different Data Environment as theDataSource property results in an error:

Runtime Error 30022, The Hierarchical FlexGrid does not support therequested type of data binding.
Resolution
If the MSHFlexGrid.DataMember is set to a Data Environment other than theoriginal, the MSHFlexGrid attempts to rebind the data using the previousDataSource property setting. Because the same Command does not exist in thesubsequent Data Environment, an error results.

BUG: Data Control Validate Event Not Fired on Unloading Form

Symptoms
A form containing a bound Data Control disables the Validate event when theform is unloaded.
Resolution
Microsoft has confirmed this to be an issue in the Microsoft productslisted at the beginning of this article. Microsoft is researching thisissue and will post new information here in the Microsoft Knowledge Base asit becomes available.