请帮忙看下这个程序
各位麻烦帮忙看一下,这个更新数据库的程序。为什么有时候能成功更新,有时候却不能Set datBroadcast = DBEngine.Workspaces(0).OpenDatabase(App.Path + "\Broadcast.MDB")
Set rsTmpTraintable = datBroadcast.OpenRecordset("SKB", dbOpenDynaset)
Set rsBroadcastContent = datBroadcast.OpenRecordset("select * from 内容 order by 时间", dbOpenDynaset)
With rsTmpTraintable
If Not (.EOF And .BOF) Then
Do
If .Fields("CC") = TR Then
.Edit
.Fields("DFXT") = "&数据已改&"
.Fields("GD") = StationWay_Receive
.Fields("JZ") = CDate(ArriveTime_Receive)
.Fields("CZ") = CDate(ArriveTime_Receive + CDate(.Fields("JC")))
.Update
End If
.MoveNext
Loop Until .EOF
End If
End With
rsTmpTraintable.Close
rsBroadcastContent.Close
datBroadcast.Close
frmProject1.Data1.Refresh
frmProject1.Adodc1.Refresh
Set Project1.HFlexGrid.DataSource = frmBroadcast.Adodc1
Project1.HFlexGrid.Refresh