Private Sub Timer1_Timer()
    Static iCount As Integer
    iCount = iCount + 1
    If iCount = 5 Then
        Dim fn As Integer
        fn = FreeFile()
        If Len(Dir("c:\temp.txt")) = 0 Then
            Open "c:\temp.txt" For Output As #fn
        Else
            Open "c:\temp.txt" For Append As #fn
        End If
        Write #fn, txtSendData.Text
        Close #fn
        iCount = 0
    End If
End Sub
现要将TXTSendDate.Text中的内容存到当前文件夹中的ACCESS数据库中TABLE1表的wendu中,同时还要保存当前系统时间到TABLE1中的time中.查询时输入时间,就能显示当时的温度.

解决方案 »

  1.   

    给个笨方法:
    定义个TEXT
    隐藏,默认值为gettime()
    将它和txtSendData一起动态绑定到TABLE1的time
    点保存时 addnew()
    查询就不用我说了
      

  2.   

    楼主会将TXTSendDate.Text的内容写入了ACCESS数据库中的表WENDU吧,如果会的话,那要插入时间字段是很容易的啊。你只要在写入的过程中,增加一个系统时间字段就可以啊。