【发布时间】:2018-11-23 07:16:19
【问题描述】:
Windows 10 Build 17134(2018 年 4 月)已开始影响用户。
软件:
- 从网络共享运行(例如 \\hydrogen\Contoso\Grobber.exe)
- 连接到 SQL Server 数据库
- 使用 OLEDB
它失败并出现错误:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或访问被拒绝
如果软件在本地 PC 上运行,它可以正常工作。
使用 ADO
我尝试过使用 ADO COM 对象:
String connectionString = "Provider=sqloledb;Data Source=screwdriver;Integrated Security=SSPI;";
Connection cn = CreateComObject("ADODB.Connection") AS Connection;
cn.Open(ConnectionString, "", "", 0);
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或访问被拒绝
使用 OLE DB
没人知道,ADO 是过度设计的 OLE DB API 的友好包装器:
String connectionString = "Provider=sqloledb;Data Source=screwdriver;Integrated Security=SSPI;";
IDataInitialize dataInit = CreateComObject(CLSID_MSDAInitialize) as IDataInitialize;
IDBInitialize provider;
dataInit.GetDataSource(nil, CLSCTX_INPROC_SERVER, ConnectionString, IDBInitializeSC, out provider);
provider.Initialize; //Actually opens the connection to the database
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server 不存在或访问被拒绝
并使用 Delphi XE6 的 ADOdb 包装器
由于我使用的是 Delphi,我认为使用 Delphi 自己的 ADODB 对象包装器包含一个 CMRE 是没有用的:
program W10OleDbTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
ComObj,
ADOdb,
ADOInt,
ActiveX,
WinApi.OleDb;
var
cs: string;
conn: TADOConnection;
begin
conn := TADOConnection.Create(nil);
conn.ConnectionString := 'Provider=sqloledb;Data Source=screwdriver;Integrated Security=SSPI;';
WriteLn('Opening connection to database using TADOConnection...');
try
conn.Open;
WriteLn('Successfully connected to database using TADOConnection');
except
on E:Exception do
WriteLn('Exception connecting to database using TADOConnection: '+E.Message);
end;
Writeln('Press enter to close.');
ReadLn;
end.
Windows 10 正在做什么以破坏应用程序 - 我如何告诉它停止它?
- 客户端电脑:Windows 10 Build 17134
- SQL Server:SQL Server 2005
- 网络共享:Windows Server 2003 R2
查看release notes from Build 17134,没有与此类相关的更改;所以我认为这是一个错误。
奖金聊天
- 对可执行文件进行数字签名没有区别
- 通过 IP 地址(而不是名称)指定 SQL Server 没有区别
- 以管理员身份运行应用程序没有区别
- 关闭域、公共和私人防火墙没有区别
- 关闭 Windows Defender 没有任何影响
- 关闭 Windows Defender 实时保护没有任何区别
SMB 版本 1
这似乎是一种意外的安全功能(即我无法禁用的功能),如果应用程序从 SMB 1(与 SMB 2 或 SMB 3)共享启动时,它们会阻止它们打开网络连接:
| SMB Version | Result | Example of product |
|-------------|-----------|------------------------|
| 1.5 | Fails | Windows 2000 |
| 1.5 | Fails | Synology NAS |
| 2.0 | Works | Windows Server 2008 |
| 2.1 | Works | Windows Server 2008 R2 |
显然,正确编写的应用程序在更新到 Windows 后失败是不好的。
您可以通过从 Powerhell 命令提示符运行来获取正在使用的 SMB 版本:
> Get-SmbConnection
ServerName ShareName UserName Credential Dialect NumOpens
---------- --------- -------- ---------- ------- --------
screwdriver Fizbang SOVERFLOW\ian SOVERFLOW\ian 2.0.2 6
hydrogen Contoso SOVERFLOW\ian SOVERFLOW\ian 1.5 6
阅读奖励
- https://changewindows.org/build/redstone4/17134/pc????
- Windows 10 Version 1803 Update Breaks Some Applications (????)
- KB4284835:June 12, 2018—KB4284835 (OS Build 17134.112) (????)
- Windows 10 Fall Creators Update and Synology NAS (????)
- KB4034314:SMBv1 is not installed by default in Windows 10 Fall Creators Update and Windows Server, version 1709 and later versions (????)
- Windows 10 1803 can’t run EXE files from a network shared folders (????)
- [RS4:1803]Windows 10 1803 won't run ODBC SQL connected application from network (????)
【问题讨论】:
-
它是否从 c: 驱动器运行?
标签: windows-10 oledb ado smb delphi-xe6