从数据库中读出相同时间的数据
数据表的定义
Option Explicit
Dim aVoice As New SpVoice
Dim bVoice As New SpVoice
Dim cnnn As New ADODB.Connection
Dim rsss As New ADODB.Recordset
Private Sub Form_Load()
Dim D As Data
On Error Resume Next
Adodc1.ConnectionString = "Provider=Microsoft.Jet.oledb.4.0;Data Source=E:\车站广播系统1\数据库\Databus.mdb"
Adodc1.RecordSource = "select * from dbi"
Set DataGrid1.DataSource = Adodc1
D = Time()
cnnn.Open "Provider=Microsoft.Jet.oledb.4.0;Data Source=E:\车站广播系统1\数据库\Databus.mdb"
rsss.Open "Select * From dbi Where time=D, cn, adOpenKeyset, adLockOptimistic"
//由于现在系统时间是10:10:10秒,但是,表中可能存放两条或者三条10:10:10分的数据。
//我要一条一条的读出,应该怎么处理?
txt = "尊敬的旅客们从" & rsss.Fields(1) & "开往" & rsss.Fields(2)
//读出一条信息,只能是一条、我也可以说多添加TEXTBOX来处理,希望有高手给我指点。
aVoice.Speak "<LANG LANGID='804'>" & txt.Text & "</LANG> SVSFIsXML "///读出txt.Text 的内容
txt = ""//读完就清空
Timer1.Interval = 60000///一分钟
End Sub
Private Sub Timer1_Timer()
Dim D1 As Data
txt = "select * from dbi where time=D1"
//由于一分钟触发一次,例如:现在系统时间是“10:10:10”读过一次数据,但是要10:11:10才读下一次的数据
这样就把10:10:50,这条数据给漏了。。。
bVoice.Speak "<LANG LANGID='804'>" & txt.Text & "</LANG> SVSFIsXML "
txt = ""
End Sub
问题多多,希望大家多多帮忙!