【发布时间】:2013-01-06 16:46:41
【问题描述】:
我正在寻找一种将数据从 Excel 推送到 Access 数据库的方法。我找到了下面的代码,但我不知道如何改进它。
Dim wsQS As Worksheet
Dim sConnect As String
Dim sCommand As String
Dim adoCn As ADODB.Connection
Set wsQS = Worksheets("QueryStrings")
Set adoCn = New ADODB.Connection
sConnect = wsQS.Range("rngConnect").Value
sCommand = wsQS.Range("rngCommand").Value
' Get ADO connection to the workbook
adoCn.Open sConnect
' Append data from Excel worksheet
adoCn.Execute sCommand
' Close the connection to the workbook
adoCn.Close
Set adoCn = Nothing
Worksheets("CopyToDB").Range("DataToExport").Offset(1, 0).ClearContents
Worksheets("Proj DB").Activate
Set wsQS = Nothing
架构
------------------
| web |
| page |
------------------
|
|
|
Python and BS4(Data Extraction)
|
|
|
------------------
| Excel |
| data |
------------------
|
|
|
Python to Push Data(Oracle/Access)
|
|
|
------------------
| Any |
| DB |
------------------
【问题讨论】:
-
你为什么在 Excel 端工作?接下来发生什么?为什么不简单地链接到 Access 或使用 Access 中的 Transferspeadsheet?
-
看到我在
python中有脚本,它从网页收集数据。现在什么时候结束,然后我就完成了收集,然后想将数据推送到数据库!
标签: vbscript excel-2010 ms-access-2010