Visual Basic 2010:如何将这两个值放在数据库的同一行中?

时间:2015-09-20 02:03:21

标签: database visual-studio-2010

Visual Basic 2010:如何将这两个值放在数据库的同一行?

按钮1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim rst As ADODB.Recordset
        rst = opentable("Select * from timesheet", ADODB.CursorLocationEnum.adUseServer)
        With rst
            .AddNew()
            .Fields("time1").Value = Date.Now
            .Update()
            MsgBox("Time in")
        End With
    End Sub

按钮2

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim rst As ADODB.Recordset
        rst = opentable("Select * from timesheet", ADODB.CursorLocationEnum.adUseServer)
        With rst
            .AddNew()
            .Fields("time2").Value = Date.Now
            .Update()
            MsgBox("Time Out")
        End With
    End Sub

0 个答案:

没有答案