Database Visual Basic 2010:如何将这两个值放在数据库的同一行中?
Visual Basic 2010:如何将这两个值放在数据库的同一行中 按钮1Database Visual Basic 2010:如何将这两个值放在数据库的同一行中?,database,visual-studio-2010,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.CursorLoca
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
您需要添加更多细节。您试图添加哪两个值?您想将它们添加到哪里?在Button1\u Click、Button2\u Click或其他位置?你试过什么?我没有看到任何将两个值相加的尝试。我的意思是将它们放在数据库中的同一行中,单击这两个按钮得到的两个值请显示尝试将两个值相加的代码。抱歉,我使用了错误的单词,我只想把它们放在同一行中,因为如果我单击第二个按钮,它会添加到下一行。AddNew do?