原帖由 Henry D. Sy 于 2008-12-21 23:01 发表
Dim conn As New ADODB.Connection
Dim sq As String
set conn=currentproject.Connection
sq = "INSERT INTO 库存查询 select * from 所有商品库存"
cnn.Execute sq
原帖由 Henry D. Sy 于 2008-12-21 22:02 发表
请参阅insert into语句
请教大侠
具体代码怎么写:
Private Sub Command0_Click()
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim sq As String
conn.Open "provider=Microsoft.jet.OLEDB.4.0;Jet OLEDBatabase Password=123;data source=" & ThisWorkbook.Path & "\库存.MDB"
cnn.Execute ("delete * from 库存查询")
sq = "INSERT INTO 库存查询 select * from 所有商品库存"
cnn.Execute sq
cnn.Close
Set cnn = Nothing