access数据库中存在3个表有效数据表A,全部数据表B,无效数据表C ,在修改了有效数据表A后,为了更新B和C,操作如下:1.清空B,C;
2.以for i=1 to n 的方式顺序判断A中是否有符合和i相关的数据(说明:A和C中含有与i无关的数据)
3.没有符合条件的情况:则插入到C中,同时也插入B中
4.有符合条件的情况:则插入到B中完成操作后,分别显示A,B,C是报错:3167:“record is deleted”不知为何?是因为数据量大的原因吗(两三万条)?
2.以for i=1 to n 的方式顺序判断A中是否有符合和i相关的数据(说明:A和C中含有与i无关的数据)
3.没有符合条件的情况:则插入到C中,同时也插入B中
4.有符合条件的情况:则插入到B中完成操作后,分别显示A,B,C是报错:3167:“record is deleted”不知为何?是因为数据量大的原因吗(两三万条)?
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.