vb中,错哪 里了 5
PrivateSubCommand1_Click()DimsSheetNameAsStringDimsExcelPathAsStringDimsAccessTableAs...
Private Sub Command1_Click()
Dim sSheetName As String
Dim sExcelPath As String
Dim sAccessTable As String
Dim sAccessDBPath As String
Dim db As Database
Dim Rs As Database
Set db = OpenDatabase(sExcelPath, True, False, "Excel 8.0") '打开电子表格文件 显示找不到可插入的ISAM
sAccessDBPath = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\jxc.mdb;Persist Security Info=False;Jet OLEDB:Database Password=admin"
sAccessTable = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\jxc.mdb\采购领图"
sSheetName = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\Book1.xls;Extended Properties='Excel 8.0;'"
Call db.Execute("insert into [;database=" & sAccessDBPath & "]." & sAccessTable & " Select * FROM [" & sSheetName & "$]")
MsgBox "Table exported successfully.", vbInformation, "Yams"
End Sub 展开
Dim sSheetName As String
Dim sExcelPath As String
Dim sAccessTable As String
Dim sAccessDBPath As String
Dim db As Database
Dim Rs As Database
Set db = OpenDatabase(sExcelPath, True, False, "Excel 8.0") '打开电子表格文件 显示找不到可插入的ISAM
sAccessDBPath = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\jxc.mdb;Persist Security Info=False;Jet OLEDB:Database Password=admin"
sAccessTable = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\jxc.mdb\采购领图"
sSheetName = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\Book1.xls;Extended Properties='Excel 8.0;'"
Call db.Execute("insert into [;database=" & sAccessDBPath & "]." & sAccessTable & " Select * FROM [" & sSheetName & "$]")
MsgBox "Table exported successfully.", vbInformation, "Yams"
End Sub 展开
展开全部
Set db = OpenDatabase(sExcelPath, True, False, "Excel 8.0")
sExcelPath 未赋值啊
sExcelPath 未赋值啊
追问
sExcelPath = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=D:\Book1.xls;"
这句话加上去 ,还是出现同样的错误,难道是其它地方出错了,还请帮忙看看
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询