SqlConnection Error if EXE is executed from network path

谁都会走 提交于 2019-12-03 04:50:25

Finally I found the problem: in the server with the shared folder, SMBv2 is disabled (I don't know why) so only SMBv1 is active; the same program executed from the same client in the same network but located on a server with SMBv2 enabled works fine.

So the problem is about SMBv1 share, deprecated starting from Windows 10 1803

This blog gives a solution to this, which worked for us. Specifically look at the answer from "M.Hermann": Windows 10 1803 won't run ODBC SQL connected application from network

The below link seems to explain why SMBv1 is disabled: SMBv1 is not installed by default in Windows 10 Fall Creators Update and Windows Server, version 1709 and later versions

I'm not sure why this only seems to be a problem after 1803 though, since SMBv1 has been disabled since 1709.

Olivier

I have same problem with some application write in "Rad Studio 10.2"

I find a solution for me, i change my connection string by deleting the parameter "Network Library = dbmssocn"

I change this :

Provider=SQLOLEDB.1;Password=MyPassword;Persist Security Info=True;User ID=MyUser;Initial Catalog=MyDb;Data Source=MyServer;Network Library=dbmssocn;

To this :

Provider=SQLOLEDB.1;Password=MyPassword;Persist Security Info=True;User ID=MyUser;Initial Catalog=MyDb;Data Source=MyServer

Now all work fine !

You are attempting to execute and untrusted executable (by default for any .exe on a network share). It is therefore restricted in what it can do.

Try right-clicking the exe and doing a 'run as administrator'.

You might also try looking into the local security policy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!