Article ID: 223082
Article Last Modified on 5/17/2007
APPLIES TO
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft ActiveX Data Objects 1.5
- Microsoft ActiveX Data Objects 2.0
- Microsoft ActiveX Data Objects 2.1
This article was previously published under Q223082
SYMPTOMS
If an OLE DB Simple Provider (OSP) is the bound DataSource for a Data Grid and an attempt is made to delete all the rows in the Data Grid, the following error is generated on the deletion of the last row:
STATUS
Microsoft 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:
MORE INFORMATION
Steps to Reproduce Behavior
- Obtain the following two files from the Data Access SDK:
- ospsampb.dll
- sampleosp_vb.regNOTE: The Data Access SDK can be downloaded from the following location:
http://msdn2.microsoft.com/en-us/data/aa937695.aspx)
- Use Regsvr32 to register the ospsampb.dll.
- Double-click the sampleops_vb.reg file to properly register ospsampb.dll as a OLE DB Simple Provider.
- Start Visual Basic 6.0 and create a Standard EXE project. Form1 is created by default.
- Set the following project references:
- Microsoft ActiveX Data Objects
- Microsoft Data Adapter Library
- Sample OLE DB Simple Provider (Visual Basic 98) - Add the following control to the default form and set its AllowDelete property to True:
- Microsoft DataGrid Control (OLE DB)
Paste the following code into the default form:
Dim da As New DataAdapter Dim ds As New MyDataSource Set da.Object = ds DataGrid1.DataMember = App.Path & "\Customer.txt" Set DataGrid1.DataSource = da
- Save the project.
- Paste the following text into Notepad.exe:
5;2
CustomerID;CompanyName;
WANDK;Die Wandernde Kuh;
WARTH;Wartian Herkku;
WELLI;Wellington Importadora;
WHITC;White Clover Markets;
WILMK;Wilman Kala; - Save the file as "Customer.txt" in the same directory as the Visual Basic project created above.
- Run the Project, click on a row's Row-Indicator (the left-most column) to select the entire row, and press the DELETE key to delete the row.
- Repeat the step above for each row in the grid.
Keywords: kbbug kbctrl kbdatabinding kbfix kbmdacnosweep kbnoupdate kbvs600sp3fix KB223082