BUG: 16-Bit Data Control Bound to OLE Control Returns Error

Last reviewed: November 28, 1995
Article ID: Q140031
The information in this article applies to:
  • Professional and Enterprise Editions of Microsoft Visual Basic, 16-bit only, for Windows, version 4.0

SYMPTOMS

A Visual Basic 16-bit program with a data control bound to an OLE container control does not retrieve the data stored in a database. When you try to retrieve the data through the data control, the error message "Error Loading From File" is displayed.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Step to Reproduce Problem

  1. Start 16-bit Visual Basic 4.0, or if it is already running, click New Project on the File menu.

  2. Add a data control, two command buttons, and an OLE container control to the Form1 form.

  3. Set the DataSource property of the OLE container control to the Data1 data control.

  4. Copy the following code sample to the Form1 code window:

          Private Sub Command1_Click()
    
             Data1.Recordset.AddNew
             Ole1.InsertObjDlg
          End Sub
    
          Private Sub Command2_Click()
             Data1.Recordset.Update
          End Sub
    
          Private Sub Form_Load()
             Dim db As Database
             Dim td As TableDef
             Dim fl As Field
    
             If Dir("C:\OLETEST.MDB") = "" Then
                Set db = CreateDatabase("C:\OLETEST.MDB", dbLangGeneral)
                Set td = db.CreateTableDef("OleObjects")
                Set fl = td.CreateField("Object", dbLongBinary)
                td.Fields.Append fl
                db.TableDefs.Append td
                db.Close
             End If
    
             Ole1.DataField = "Object"
             Data1.DatabaseName = "C:\OLETEST.MDB"
             Data1.RecordSource = "OleObjects"
             Data1.Refresh
    
             Command1.Caption = "&Add New"
             Command2.Caption = "&Update"
          End Sub
    
    

  5. On the Run menu, click Start, or press the F5 key to start the program.

  6. Click Add New. The error message "OLE Automation error" appears in the OLETEST dialog box. Click OK to close the message box. The Insert Object dialog box is displayed.

  7. Use the following steps to insert an object into the OLE container:

    a. On the Object Type list box, click Paintbrush Picture, then click

          OK. The Paintbrush window appears.
    

    b. Draw anything in the window.

    c. On the File menu, click Exit and return to the (Untitled) menu

          item. The Paintbrush dialog box is displayed.
    

    d. Click Yes to close the Paintbrush dialog box and the Paintbrush

          program. The image drawn in the Paintbrush program no longer
          appears in the OLE container in the Visual Basic program.
    

  8. Click Update. The OLE container is now blank.

  9. On the Data1 data control, click Back. While using Microsoft Windows NT or Microsoft Windows 95, the error "Error Loading From File" is displayed. While using Microsoft Windows for Workgroups, a general protection fault occurs.


Additional reference words: 4.00 VB4WIN VB416 buglist4.00
KBCategory: kbprg kbbuglist kberrmsg
KBSubcategory: IAPOLE PrgCtrlsStd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 28, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.