Article ID: 113687
Article Last Modified on 10/29/2003
APPLIES TO
- Microsoft Visual Basic 3.0 Professional Edition
- Microsoft Visual Basic 3.0 Professional Edition
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
Additional query words: buglist3.00 3.00 fixlist4.00 GPF
Keywords: kbbug kbfix KB113687