Private Sub Bupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bupdate.Click
Dim objConn As New OleDb.OleDbConnection
Dim dtAdapter As OleDb.OleDbDataAdapter
Dim dt As New DataTable
Dim strConnString, strSQL As String
Dim name As String
Dim name1 As String
Dim name2 As String
Dim name3 As String
Dim name4 As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\att.mdb;Jet OLEDB:Database Password=;"
objConn.ConnectionString = strConnString
objConn.Open()
strSQL = "SELECT * FROM A"
dtAdapter = New OleDb.OleDbDataAdapter(strSQL, objConn)
While dtAdapter.Fill(dt)
name = dt.Rows(0)("UserID")
name1 = dt.Rows(0)("CHECKTIME")
name2 = dt.Rows(0)("CHECKTYPE")
name3 = dt.Rows(0)("WorkCode")
name4 = dt.Rows(0)("UserExtFmt")
Dim sql As String
sql = "insert into B(UserID,CHECKTIME,CHECKTYPE,WorkCode,UserExtFmt) values('" & name.ToString() & "','" & name1.ToString() & "','" & name2.ToString() & "','" & name3.ToString() & "','" & name4.ToString() & "')"
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql, objConn)
cmd.ExecuteNonQuery()
End While
End Sub
Private Sub Bupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bupdate.Click
Dim objConn As New OleDb.OleDbConnection
Dim dtAdapter As OleDb.OleDbDataAdapter
Dim dt As New DataTable
Dim strConnString, strSQL As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\att.mdb;Jet OLEDB:Database Password=;"
objConn.ConnectionString = strConnString
objConn.Open()
strSQL = "SELECT * FROM checkp "
dtAdapter = New OleDb.OleDbDataAdapter(strSQL, objConn)
Dim sql As String
sql = "insert into checkinout(UserID,CHECKTIME,CHECKTYPE,WorkCode,UserExtFmt)SELECT UserID,CHECKTIME,CHECKTYPE,WorkCode,UserExtFmt FROM checkp "
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand(sql, objConn)
cmd.ExecuteNonQuery()
End Sub