从某个来源获取数据 访问 文件插入 谷歌工作表
在 Google 表格中打开您的 Access 数据库,并随时刷新。无需上传 CSV 文件,无需使用 Apps Script,也无需复制粘贴。首次操作大约需要十分钟,而且免费套餐就包含了这项功能。
你最终会得到什么
一个 Google 表格,实时显示针对 Access 文件执行 SQL 查询的结果,并带有一个按钮,可在数据更改时自动更新最新行。例如:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | customer_id | 名 | 姓 | 国家 | 总计 |
| 2 | 1042 | 玛丽亚 | 阿尔瓦雷斯 | 美国 | 1,284.50 |
| 3 | 1043 | 丹尼尔 | 奥卡福 | 美国 | 612.00 |
| 4 | 1047 | 普里亚 | 奈尔 | 美国 | 2,090.75 |
| 5 | 1051 | 托马斯 | 伯格 | 美国 | 338.20 |
| 6 | 1056 | 露西亚 | 费雷拉 | 美国 | 1,455.00 |
| 7 | 1060 | 健二 | 佐藤 | 美国 | 874.10 |
| 8 |
来自 orders.accdb 的实时数据Microsoft Access 数据库是单个文件,通常以 .php 结尾。 .accdb, .mdbGoogle Sheets 根本无法打开这些文件,通常的解决方法是导出 CSV 文件,然后在每次数据更改时重新上传。Query Streams 则无需如此:一个小型辅助程序会读取文件所在的位置,然后 Google Sheets 插件会向其请求所需的行。这两个程序无需位于同一台计算机上。文件可以位于办公室电脑上,而您可以随时随地使用任何设备上的任何浏览器访问该文件。
你需要准备什么
The Agent on a computer that can open the file
这是一个在后台运行的小程序,当 Google Sheets 发出请求时,它会读取该文件。下面的步骤 2 展示了如何获取该程序。
您的 Access 文件
例如,要知道它在哪里。 C:\Data\orders.accdb 或 \\server\share\orders.accdb. If it lives in OneDrive, Dropbox or Google Drive, make sure it is synced to the Agent’s computer.
哪个计算机获得代理? The one where the file is, or one that can open it from a network share (see Reaching a file on a network share below). That computer needs to stay on. Google Sheets 可以放在任何地方它在浏览器中运行,因此在您读取数据时不会安装任何东西。
分五步连接
-
创建您的帐户
前往 my.querystreams.com 并注册。选择 免费 计划。这是一个正式的计划,不是试用版,它涵盖了连接 Access 文件和从 Google Sheets 运行查询的内容。
Install the Agent on a computer that can open the file



登录,打开 下载, and install the Agent for your system on the computer where the file is, or on one that can open it from a network share. It takes a minute and starts on its own from then on.
为什么使用小型程序而不是驱动程序? The Agent is one install for Windows, Mac or Linux (about 85 MB on Windows, a little over 100 MB on Mac and Linux) that runs quietly in the background. It makes one outbound, encrypted connection to Query Streams, the same way a browser does, so you open no firewall port and set up no VPN. The file stays where it is, and the rows travel to wherever you are, across the internet if need be. The only thing on your side is the add-on.
下载页面显示 您的访问密钥当代理提示时,将其粘贴到代理中,然后等待徽章读取。 已连接到查询流这是你在代理程序本身上唯一需要做的事情。
-
将其指向您的 Access 文件
返回浏览器,打开 数据代理 (在下面 数据 (在顶部菜单中)。您的经纪人信息就在那里。点击 添加连接器, 选择 Microsoft Access并填写:
首先要检查一件事。 特工的电脑需要微软免费的 64 位操作系统。 访问数据库引擎门户网站会在您选择 Microsoft Access 时立即检查它并显示一个信息。 下载引擎 button if it is missing. If that computer has 32-bit Office, do not install the engine there: If the computer has 32-bit Office. File on another computer? See Reaching a file on a network share 以下。
- 连接名称
- 任何你以后会记住的名称,例如销售数据库。
- 数据库文件路径
- Where the Access file (.accdb or .mdb) is: a path on the Agent’s computer, like C:\Data\orders.accdb, or a network path, like \\server\share\folder\orders.accdb, never a mapped drive letter such as S:. Use Browse to pick it.
点击 测试连接当它读到 已连接, 点击 节省连接会在几秒钟内到达您的代理。
测试失败? Usually the database engine is not installed (the banner above the form says so), the path uses a mapped drive letter such as S: that the Agent service cannot see (type \\server\share\folder\file.accdb instead), or the path has a typo. A share that turns the Agent away is covered under Test failed on a share? 以下。 每条测试消息及其修复.
-
See your data in Query Builder 选修的
You can look at your Access file before Google Sheets is involved at all. Open 查询生成器 in the portal and pick the connection you just made. The 模式 tab lists your tables and columns, and clicking one puts its name in the editor, so you can write a query without remembering exact names. Click 运行 and the rows appear under 成果. Query Builder is on every plan, Free included.
On Business plans you can also ask Nova in plain English (“show me customers in the USA”) and it writes the SQL for you. When the query looks right, save it: from Personal Core up it shows in the add-on’s Saved Queries list, and on any plan you can copy the SQL into the next step.
-
将查询流添加到 Google 表格
打开任意一个 Google 表格,然后转到 扩展程序 → 附加组件 → 获取附加组件搜索 查询流然后点击 安装或者直接从这里安装 Google Workspace Marketplace 上的查询流谷歌会要求你允许安装该插件;这是正常现象。
之后,您打开的每个 Google 表格中都会出现“查询流”图标,位于右侧边栏,也列在“查询流”下方。 扩展无需单独登录。它会识别您已在使用的 Google 帐户,因此该电子邮件地址必须与您的 Query Streams 帐户所用的电子邮件地址一致。
-
把你的第一张桌子拉过来
单击工作表右侧侧面板中的“查询流”图标(或在下方找到它)。 扩展)。 选择 查询流 选择你刚刚建立的连接。
输入要运行的查询语句。以下查询语句会从数据库中提取几列数据。 客户 桌子:
示例 · SQLSELECT TOP 100 CustomerID, CompanyName, City FROM Customers ORDER BY CompanyName;
在下面 目的地表 选择行应该落入的选项卡,然后单击 运行查询数据行会在一两秒内显示在该标签页中。如果数据发生更改,请随时再次单击“运行查询”,标签页将自动更新。
不懂SQL? Build it in 查询生成器 first and paste it here, or pick it from Saved Queries if you saved it.
Reaching a file on a network share
If the test cannot get to the share, look for these words in its result: unreachable means the Agent’s computer got no answer from the server.
Microsoft Access file on a share? The account the Agent reads with needs Modify permission on the folder, because Access creates a .laccdb lock file beside the database even when it only reads. Do not run the Agent for Access on a computer with 32-bit Office; use a dedicated computer without it. Signing in to the file server · If the computer has 32-bit Office
Test failed on a share?
A Windows Agent signs in to the file server itself, so its test result can also say:
| 留言 | 原因 | 使固定 |
|---|---|---|
| Access denied for the agent’s service account under the path, or 拒绝访问 in the test result | The share lets in named people only, and the Agent’s own Windows account is not one of them. Or the login stored for that server may not read this share. | 点击 Service identity under the path and store a login that can read the share. If one is stored already, ask whoever runs the server to give that account read access. |
| the credentials were refused | The server turned the stored login down: a typo, the wrong domain, or a password changed since it was saved. | Click the account name under the path and type the login again; for an account made on the server itself, leave Domain blank. were refused moments ago means the Agent waits a minute before it tries that same login again, so the account is not locked out; saving a corrected password tries again straight away. |
| Another connector on this agent already signs in to,或 Windows already holds a sign-in to | This Windows computer already signs in to that server as a different account, through another connector or another program. Windows allows one account per server. | Store the login the other connector uses, or change it on every connector that reads that server. After Windows already holds a sign-in, the rest of the message says which account it is and what to do. |
| The agent cannot write to the folder containing the Access database | The account can read the file but cannot create the .laccdb lock file beside it. | Give that account Modify permission on the folder, the same as any Access user has. |
| This agent build cannot sign in to | The Agent is an older version that cannot use stored share logins. | Update the Agent, then test again. |
就是这样。 您的数据已保存在表格中,只需单击一下即可保持最新状态。除了您请求的行之外,没有任何数据会离开您的网络。
下一步行动不错。
- 保存查询 在门户网站中,您可以一键再次运行它,也可以从 Google Sheets 或 Excel 中运行。
- 添加筛选器 例如日期范围,这样同一个查询就可以回答“本月”而无需编辑。
- 分享结果 与同事一起操作。他们看到的是行,而不是你的文件和文件路径。
人们提出的问题
你的 Access 文件必须放在我运行 Google 表格的电脑上吗?
No. Only the Agent has to be able to open your Access file. Google Sheets runs in your browser on any device. Open the add-on with the same Google account and your connections are there.
我的数据库文件会被上传到哪里吗?
No. The Agent reads the file where it sits and sends only the rows your query asks for. The file stays where it is.
文件可以存储在 OneDrive、Dropbox 或 Google Drive 中吗?
是的,只要它与运行代理的计算机同步,代理就能将其视为普通的本地文件。将连接指向同步的副本即可。
免费套餐真的包含这些吗?
是的。“免费”是一个永久有效的方案,而不是会过期的试用期。请查看具体包含内容。 定价页面.
表格会自动刷新吗?
如需获取最新行,请再次单击“运行查询”。要设置工作表自动刷新(无需用户手动操作),请在“查询流”门户(“流”→“自动化”)中设置自动化。此功能在所有套餐中均有提供。
相关指南
每份指南 Access
Setup trouble?
- Access engine will not install, the file is on a mapped drive, or Test connection fails? The Access setup page walks each fix click by click → Microsoft Access connector setup
- Agent shows Offline, or Test connection and Browse are greyed out? Check that the Agent is online → Is the Agent online?

