Excel 中的查询超时设置

发布于 2024-10-07 05:54:28 字数 386 浏览 0 评论 0原文

我是该网站的新手,我想尝试一下,看看是否可以获得有关 Excel 中 SQL 查询的任何答案。

如果 Microsoft Excel 中发生超时(主要是 Win XP/Vista/7 上的 2007/2010),是否有办法处理?如您所知,您可以将 Excel 连接到 Microsoft SQL Server 并通过 Excel 运行查询。唯一的问题是我似乎没有找到任何超时选项。举个例子,如果有一个错误的查询,这可能会锁定 SQL Server (2005) 数据库中的其他表。

我不是在寻找剧本。它更像是我需要的设置,如果可能的话,我想将这些超时设置添加到特定的 Windows 用户帐户。 SQL Server 2005 或 Microsoft Excel 2007/2010 中的设置。

此致 /亨里克

new to the site I'd like to give it a shot and see if I can get any answers regarding SQL Querys in Excel.

Is there a way to handle if a Timeout occurs in Microsoft Excel (mostly 2007/2010 on Win XP/Vista/7)? As you know you can connect Excel to a Microsoft SQL Server and run your query via Excel. The only thing is that I don't seem to find any Timeout options for this. And for an example, if there is a bad query, this might lock other tables in the SQL Server (2005) database.

I'm not looking for a script. It's more like settings I need and if possible I would like to add these Timeout settings to a specific Windows user account. Settings in either SQL Server 2005 or in Microsoft Excel 2007/2010.

Best regards
/Henrik

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯下孤影 2024-10-14 05:54:28

使用CommandTimeout属性

Dim objCommand As ADODB.Command
Set objCommand = New ADODB.Command

objCommand.CommandTimeout = 99 '
objCommand.ActiveConnection = cnConn
objCommand.CommandText = "DELETE Users WHERE IdLevel < 98"
objCommand.Execute

Use the CommandTimeout property

Dim objCommand As ADODB.Command
Set objCommand = New ADODB.Command

objCommand.CommandTimeout = 99 '
objCommand.ActiveConnection = cnConn
objCommand.CommandText = "DELETE Users WHERE IdLevel < 98"
objCommand.Execute
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文