ACC: New SQL Records Appear Deleted Until Recordset Reopened (135379)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q135379 SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you add a record to an SQL table by using Visual Basic for
Applications, if the table's unique index field has a default value, and
you do not assign a value to that field, the new record appears deleted
until you reopen the SQL table. If you try to obtain a value from the new
record, you receive the following error message:
Run-time error '3167'
Record is deleted.
RESOLUTION
When you open the SQL table by using Visual Basic code, include the
dbSeeChanges option, as in the following example:
Set rs = db.OpenRecordset("TestTable", dbOpenDynaset, dbSeeChanges)
The dbSeeChanges option ensures that any newly added records that contain
a default value in the unique index field are available in the current
recordset.
STATUS
This behavior is by design.
REFERENCES
For more information about the OpenRecordset method, search the Help Index
for "OpenRecordset," and then "OpenRecordset method," or ask the Microsoft
Access 97 Office Assistant.
Modification Type: | Minor | Last Reviewed: | 1/26/2005 |
---|
Keywords: | kberrmsg kbprb kbusage KB135379 |
---|
|