FIX: AddNew Method Gives Error: Illegal Function Call (113332)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q113332 SYMPTOMS
It 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.
CAUSE
The cause of this problem has not yet been determined. We're researching
it.
WORKAROUND
There 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.AddNew
The other method is to delete the index. In the previous example, you would
delete Index1.
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbbug kbfix KB113332 |
---|
|