从某个来源获取数据 SQLite 文件插入 在 Excel
在 Excel 中打开您的 SQLite 数据库,并随时刷新。无需 ODBC 驱动程序,无需导出为 CSV 文件,也无需使用宏。首次操作大约需要十分钟,而且免费套餐就包含了这项功能。
你最终会得到什么
一个工作表,实时显示针对 SQLite 文件执行 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 |
SQLite 数据库是单个文件,通常以 .sqlite 结尾。 .db, .sqlite, .sqlite3Excel 本身无法打开这些文件,通常的解决方法是安装 ODBC 驱动程序并处理连接字符串。而 Query Streams 则避免了这些麻烦:一个小型辅助程序会读取文件所在的位置,然后 Excel 加载项会向其请求所需的行。这两个程序无需位于同一台计算机上。文件可以位于办公室的计算机上,而您可以身处任何地方:家里的笔记本电脑、远在异地的同事的电脑,或者网页版的 Excel。
你需要准备什么
The Agent on a computer that can open the file
这是一个在后台运行的小程序,会在 Excel 需要时读取文件。下面的步骤 2 展示了如何获取该程序。
您的 SQLite 文件
例如,要知道它在哪里。 C:\Data\sales.db 或 \\server\share\sales.db. 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. Excel 可以位于任何地方无论是在家里的笔记本电脑上,还是在全国其他地区的同事的电脑上,亦或是网页版的 Excel,都无需安装任何其他软件。
分五步连接
-
创建您的帐户
前往 my.querystreams.com 并注册。选择 免费 计划。这是一个正式的计划,不是试用版,它涵盖了连接 SQLite 文件和从 Excel 运行查询的内容。
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-in.
下载页面显示 您的访问密钥当代理提示时,将其粘贴到代理中,然后等待徽章读取。 已连接到查询流这是你在代理程序本身上唯一需要做的事情。
-
将其指向您的 SQLite 文件
返回浏览器,打开 数据代理 (在下面 数据 (在顶部菜单中)。您的经纪人信息就在那里。点击 添加连接器, 选择 SQLite并填写:
- 连接名称
- 任何你以后会记住的名称,例如销售数据库。
- 数据库文件路径
- Where the SQLite file is: a path on the Agent’s computer, like C:\Data\sales.db, or a network path, like \\server\share\folder\sales.db, never a mapped drive letter such as S:. Use Browse to pick it.
点击 测试连接当它读到 已连接, 点击 节省连接会在几秒钟内到达您的代理。
测试失败? Usually the path has a typo, or it uses a mapped drive letter such as S:, which the Agent cannot see. Open the folder, copy the path from the address bar, and paste it in again. For a file on another computer, see Reaching a file on a network share 以下。
-
See your data in Query Builder 选修的
You can look at your SQLite file before Excel 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-in’s Saved Queries list, and on any plan you can copy the SQL into the next step.
-
将查询流添加到 Excel
在 Excel 中,转到 插入 → 获取加载项搜索 查询流然后点击 添加或者直接从……打开 在 Microsoft AppSource 上查询流功能区上会出现“查询流”按钮。请使用同一帐户登录。
适用于 Windows 和 Mac 上的 Microsoft 365 Excel 以及网页版 Excel。
-
把你的第一张桌子拉过来
点击“查询流”按钮,选择 流式查询然后选择你刚刚建立的连接。
输入要运行的查询语句。以下查询语句会从数据库中提取几列数据。 客户 桌子:
示例 · SQLSELECT customer_id, name, city FROM customers ORDER BY name LIMIT 100;
在下面 目的地表 选择 创建新工作表然后按下播放按钮(▶ 箭头)。数据行会在一两秒钟内显示在 Excel 表格中。如果数据发生更改,请再次按下该按钮,表格将自动更新。
不懂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
The Agent opens files as a background service, not as you, so a file on another computer needs one extra step. Which step depends on the computer the Agent runs on.
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. On Linux or a Mac, not mounted means the share still has to be mounted, and that message includes the exact mount command for your server.
SQLite file on a share? 离开 Read-Only (Immutable) ticked, as it is by default; reads then take a point-in-time view of the file without locks. SQLite cannot use its WAL mode over a network, so with that box unticked a WAL-mode database on a \\server\share path is refused, and the test says it is a WAL-mode SQLite database.
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. |
| 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. |
就是这样。 您的数据已保存在表格中,只需单击一下即可保持最新状态。除了您请求的行之外,没有任何数据会离开您的网络。
下一步行动不错。
- 保存查询 在门户网站上,您可以一键再次运行它,也可以从 Excel 或 Google Sheets 运行。
- 添加筛选器 例如日期范围,这样同一个查询就可以回答“本月”而无需编辑。
- 分享结果 与同事一起操作。他们看到的是行,而不是你的文件和文件路径。
人们提出的问题
Excel 必须和 SQLite 文件位于同一台计算机上吗?
No. Only the Agent has to be able to open your SQLite file. Excel can be on any computer with an internet connection, including Excel on the web and Excel on a Mac. Sign in to the add-in with your 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 中吗?
是的,只要它与运行代理的计算机同步,代理就能将其视为普通的本地文件。将连接指向同步的副本即可。
免费套餐真的包含这些吗?
是的。“免费”是一个永久有效的方案,而不是会过期的试用期。请查看具体包含内容。 定价页面.
它能与Mac版Excel兼容吗?
是的。包括Mac和Windows上的Microsoft 365版Excel,以及网页版Excel。
相关指南
每份指南 SQLite
这不是你想要的配置?
- 你的 SQLite 文件不是单个文件而是多个文件?SQLite Folder 会将同名表合并成一个表,并用文件来源标记每一行数据 → SQLite Folder
- 想查询 Excel 工作簿本身吗?Excel 文件夹会将工作簿文件夹读取为表格 → Excel Folder
Setup trouble?
- Agent says the file or folder does not exist, or access is denied? Mapped drives, network shares, OneDrive and Linux home folders each need one fix → Where the Agent can read files from
- Agent shows Offline, or Test connection and Browse are greyed out? Check that the Agent is online → Is the Agent online?

