FIX: VB 6.0 Adding Split to a DataGrid May Cause Error (223077)
The information in this article applies to:
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q223077 SYMPTOMS
Adding a Split to a DataGrid generates the following error when the DataGrid is bound to an ADO Data Control:
Run-time error '-2147417848 (80010108)':
Method 'DataSource' of object 'IDataGrid' failed
The error occurs when the recordset is at BOF or at EOF or empty (both BOF and EOF) prior to binding the DataGrid.
RESOLUTION
There are two possible temporary workarounds:
- Put each newly-created DataGrid Split into a different ScrollGroup:
DataGrid1.Splits.Add 0
DataGrid1.Splits(0).ScrollGroup = 0
DataGrid1.Splits.Add 1
DataGrid1.Splits(1).ScrollGroup = 1
Note that this workaround applies to empty and non-empty recordsets. - Move to a specific record (neither BOF nor EOF) in the ADO Data Control's Recordset before binding:
Adodc1.Recordset.MoveFirst
Using this workaround, if the recordset were empty, you would modify your code to bypass the code that adds Splits.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: 194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why
194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed
Modification Type: | Major | Last Reviewed: | 10/15/2002 |
---|
Keywords: | kbBug kbCtrl kberrmsg kbVS600sp3fix KB223077 kbAudDeveloper |
---|
|