Dim strSQL As String
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
cnn.CursorLocation = adUseClient
cnn.ConnectionString = connstr
cnn.Open
。这个地方不知道怎么来实现
rs.Close
Set cnn = Nothing
在SQL里面有两个表,字段相同。要实现把A表的数据移动到B表(B表以前有数据,追加上),请教该如何实现。。谢谢
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
rs.LockType = adLockOptimistic
rs.CursorType = adOpenKeyset
cnn.CursorLocation = adUseClient
cnn.ConnectionString = connstr
cnn.Open
。这个地方不知道怎么来实现
rs.Close
Set cnn = Nothing
在SQL里面有两个表,字段相同。要实现把A表的数据移动到B表(B表以前有数据,追加上),请教该如何实现。。谢谢
cnn.Execute strsql
.
cnn.Open
cnn.Execute "insert into B select * from A"
cnn.Execute "TRUNCATE TABLE B"
cnn.Close
Set cnn = Nothing '不可以不关闭而直接noting cnn
.
cnn.Open
cnn.Execute "insert into B select * from A"
cnn.Execute "TRUNCATE TABLE A"
cnn.Close
Set cnn = Nothing '不可以不关闭而直接noting cnn
strsql="insert into 表B(id,book_name,book_num) select id,book_name,book_num from 表A "
strsql="insert into 表B(book_name,book_num) select book_name,book_num from 表A "