关于vb向ACCESS数据库写数据时发生漏记录的问题?
ntwwh 2011-08-03 05:17:29 各位高手:
请教! 关于vb向ACCESS数据库写数据时发生漏记录的问题?
源程序:
Private Sub Form_Load()
Timer4.Interval = 60000
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=I:\db1.mdb;Persist Security Info=False"
End Sub
Private Sub Timer4_Timer()
Adodc1.RecordSource = "select top 1 * from HCCG"
Adodc1.Refresh
Adodc1.Recordset.AddNew
Adodc1.Recordset.Fields(0).Value = RTYU
Adodc1.Recordset.Fields(1).Value = Time
Adodc1.Recordset.Fields(2).Value = Text0.Text
Adodc1.Recordset.Fields(3).Value = Text1.Text
Adodc1.Recordset.Fields(4).Value = Text2.Text
Adodc1.Recordset.Fields(5).Value = Text3.Text
Adodc1.Recordset.Fields(6).Value = Text4.Text
Adodc1.Recordset.Fields(7).Value = Text5.Text
Adodc1.Recordset.Fields(8).Value = Text6.Text
Adodc1.Recordset.Fields(9).Value = Text7.Text
Adodc1.Recordset.Fields(10).Value = Text8.Text
Adodc1.Recordset.Update
Adodc1.Refresh
End Sub
数据表HCCG中第11列 ,为自动生成的ID!
请教以上源程序,会造成数据表HCCG中发生漏记录的现象!
做成怎样的程序,或者有无方法进行调整!
如下面的现象:
RTYU TIME ...............................
1254 09:23:07
1254 09:24:07
1254 09:25:07
1254 09:27:07
1254 09:28:07
1254 09:29:07
如上面数据所示少了 09:26:07 的数据!
我采用
of123 海明:
的方法
Open App.path & "\log.txt" For Append As #1
Print #1, Time
Close #1
End Sub
用日志文件检查 Timer 代码此时是否被执行。
得出的结论, 确实存在没被执行的现象。
请教高手如何解决!!!!!!!!!!!!!!!!!!!!!!!!!!