如何将db表导入sql 2000
发布网友
发布时间:2022-04-25 09:03
我来回答
共2个回答
热心网友
时间:2023-11-11 14:41
现公司系统使用“Paradox”数据库保存数据,为方便分析,想转为Excel表格
但现在公司要删除Access,所以下面代码将不能达到目的,所以请各位高手帮忙,编写导入“Paradox”数据库到Excel的代码,不能使用"Access.Application"对象
以前做法:
1.使用Access程序新建数据库
2.使用Access程序导入“Paradox”数据库
3.再将导入的表导出到Excel
Private Sub ConvDb()
Const StrTableName As String = "Mrp"
Dim appAccess As Access.Application
Dim strDB As String, StrFN As String
' Initialize string to database path.
strDB = "D:\Newdb.mdb"
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.NewCurrentDatabase strDB
StrFN = "C:\wisdb\"
appAccess.DoCmd.TransferDatabase 0, "Paradox 7.x", StrFN, 0, "Drmp.db", StrTableName
StrFN = "C:\wisdb\Mrp.xls"
appAccess.DoCmd.TransferSpreadsheet 1, , StrTableName, StrFN
appAccess.Quit
Set appAccess = Nothing
Workbooks.Open StrFN, , , , , , , , , , , , True
Kill strDB
End Sub
想办法把PARADOX 中数据导出成sql2000能识别的文件格式即可。
热心网友
时间:2023-11-11 14:42
1.使用Access程序新建数据库
2.使用Access程序导入“Paradox”数据库
3.再将导入的表导出到Excel
Private Sub ConvDb()
Const StrTableName As String = "Mrp"
Dim appAccess As Access.Application
Dim strDB As String, StrFN As String
' Initialize string to database path.
strDB = "D:\Newdb.mdb"
' Create new instance of Microsoft Access.
Set appAccess = CreateObject("Access.Application")
' Open database in Microsoft Access window.
appAccess.NewCurrentDatabase strDB
StrFN = "C:\wisdb\"
appAccess.DoCmd.TransferDatabase 0, "Paradox 7.x", StrFN, 0, "Drmp.db", StrTableName
StrFN = "C:\wisdb\Mrp.xls"
appAccess.DoCmd.TransferSpreadsheet 1, , StrTableName, StrFN
appAccess.Quit
Set appAccess = Nothing
Workbooks.Open StrFN, , , , , , , , , , , , True
Kill strDB
End Sub
想办法把PARADOX 中数据导出成sql2000能识别的文件格式即可。