FIX: Field Name Same as Reserved Word Can Cause GP Fault (113687)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
This article was previously published under Q113687 SYMPTOMS
It is possible to receive a general protection (GP) fault in VB.EXE at the
address 0025:3182 when using the data access features of Visual Basic. You
may also notice corruption in your source code if the source is saved in
the binary format and reloaded. The problem may not occur all the time.
CAUSE
This problem stems from using field names that are reserved words in Visual
Basic. The problem occurs when using the following syntax to reference the
field:
Recordset![Reserved]
where "Recordset" is a table, dynaset, snapshot, or data control recordset,
and "Reserved" is any Visual Basic reserved word.
RESOLUTION
To avoid the problem use the Fields collection to refer to the field. For
example:
Recordset.Fields("Reserved").Value
Recordset("Reserved")
where "Recordset" is a table, dynaset, snapshot, or data control recordset,
and "Reserved" is any Visual Basic reserved word.
STATUS
Microsoft has confirmed this to be a bug in Visual Basic version 3.0
for Windows. This problem has been corrected in Visual Basic version 4.0.
Steps to Reproduce Problem- Start a new project in Visual Basic. Form1 will be created by default.
- Add the following code to the Form Load event:
Sub Form_Load()
Dim tb As Table
tb![To] = 12
End Sub
- Run the program. You should get an error and the code will be changed to
the following.
Sub Form_Load()
Dim tb As Table
tb!To = 12
End Sub
Modification Type: | Major | Last Reviewed: | 10/29/2003 |
---|
Keywords: | kbbug kbfix KB113687 kbAudDeveloper |
---|
|