FIX: AddNew Method Gives Error: Illegal Function CallLast reviewed: October 30, 1997Article ID: Q113332 |
3.00
WINDOWS
kbprg kbbuglist
The information in this article applies to: - Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0
SYMPTOMSIt is possible to receive an "Illegal Function Call" error message in response to an AddNew method. This article demonstrates how this error can occur and how to work around it.
CAUSEThe cause of this problem has not yet been determined. We're researching it.
WORKAROUNDThere are two ways to work around this problem. The first method is to move to the last record before adding the record. The following code demonstrates this work around:
Form1.AutoRedraw = True Data1.DatabaseName = "DB.MDB" Data1.RecordSource = "SELECT * FROM Table1 WHERE Field1 = 'Record1'" Data1.Refresh Data1.Recordset.MoveLast Print "ReadOnly "; Data1.ReadOnly Print "Options "; Data1.Options Print "Updatable "; Data1.Recordset.Updatable Data1.Recordset.AddNewThe other method is to delete the index. In the previous example, you would delete Index1.
STATUSMicrosoft has confirmed this to be a bug in Microsoft Visual Basic version 3.0 for Windows. This problem has been corrected in Visual Basic version 4.0.
MORE INFORMATIONA problem with the Microsoft Access database engine can cause an "Illegal Function Call" error when adding a record to a database. This error should not occur. This problem is not related to the data control and can also occur when using methods from the Professional Edition of Visual Basic version 3.0.
Steps to Reproduce Problem
|
Additional reference words: buglist3.00 3.00 buglist3.00 fixlist4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |