我目前正在尝试使用以下代码:
METERED
我看到行Dim s As Long: s = ActiveWorkbook.Worksheets(1).Cells(Rows.Count, "A").End(xlUp).Row
Dim acc As Object
Set acc = CreateObject("Access.Application")
acc.Visible = True
acc.OpenCurrentDatabase Application.ActiveWorkbook.Path & "\Database.accdb"
acc.CurrentDb.Execute "DELETE FROM Blad1;", 128 ' dbFailOnError = 128
acc.DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
SpreadSheetType:=acspreadsheettypeexcel12xml, _
TableName:="Blad1", _
Filename:=Application.ActiveWorkbook.FullName, _
HasFieldNames:=True, _
Range:="Sheet1$A1:N" & s
acc.CloseCurrentDatabase
acc.Quit
Set acc = Nothing
工作正常,因为它删除了表中的所有数据。在acc.CurrentDb.Execute "DELETE FROM Blad1;"
之前,一切似乎都运行良好。
这意味着'错误3170:无法找到可安装的ISAM'
我现在已经找了很长一段时间的答案,但我似乎无法找到真正解决问题的任何东西。你们认为解决方案是什么?