小编Dan*_*van的帖子

使用 SQL 将 MS Access 信息返回到 Excel 电子表格

我希望在 VBA 上运行 SQL 查询,该查询将从 MS Access 返回信息到单元格 A1。

目前,我正在运行 SQL 查询,SELECT AccountNumber, BorrowerName from AccountTable;它只返回 A 列中的帐号 - 它不返回 BorrowerName。同样,如果我要运行SELECT * from AccountTable;,它将只返回 AccountNumber 列。有任何想法吗?

(忽略直到Dim conn As New Connection

'runs an sql query
Sub RunQueryOnAccess()

    'Declaring year value of 1 month & 2 month
    'This is important to compare datasets from 2 months ago & last month
    Year_1M = Format(Date - 27, "YYYY")

    'Declaring month value of 1 month & 2 month …
Run Code Online (Sandbox Code Playgroud)

sql excel ms-access vba

0
推荐指数
1
解决办法
40
查看次数

标签 统计

excel ×1

ms-access ×1

sql ×1

vba ×1