ACC2000: New SQL Records Appear Deleted Until Recordset Reopened (208799)
The information in this article applies to:
This article was previously published under Q208799 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
When you add a record to an SQL table 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
To resolve this behavior, 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.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kberrmsg kbprb kbusage KB208799 |
---|
|