帮忙看一下代码怎么改呢,急,求助
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Call main1
Set rs = adoCon.Execute("select * from 终检档案 where 批号=' Sheet1.Cells(A) ' and 管号=' Sheet1.Cells(B) ' ")
If rs.EOF = False Then
MsgBox "数据重复", 4, "成品管理系统"
Else
db.Open "Provider=Microsoft.ace.OLEDB.12.0;Data Source=" & App.Path & "\storage.accdb" & ";Persist Security Info=False"
Call db.Execute("INSERT into 终检档案 SELECT * From [Sheet1$] In '" & sPath & "' 'excel 8.0;'")
MsgBox "导入成功", vbOKOnly, "提示"
db.Close
Set db = Nothing
查询终检档案 档案中批号和管号与 excel中A列与B列中数据相同的禁止导入怎么代码更改 Excel
[解决办法]
Set rs = adoCon.Execute("select * from 终检档案 where 批号='"& Sheet1.Cells(A) &"' and 管号='"& Sheet1.Cells(B) &"'")