Article ID: 208799 - Last Review: June 23, 2005 - Revision: 3.0 ACC2000: New SQL Records Appear Deleted Until Recordset Reopened
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). On This PageSYMPTOMS
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:
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Steps to Reproduce BehaviorNOTE: The sample code in this article uses Microsoft Data Access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected.
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top