pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

如果從網絡路徑執行 EXE,則 SqlConnection 錯誤

SqlConnection Error if EXE is executed from network path(如果從網絡路徑執行 EXE,則 SqlConnection 錯誤)
本文介紹了如果從網絡路徑執行 EXE,則 SqlConnection 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

首先:您在這篇文章中讀到的所有內容在安裝了 Windows 10 April 2018 更新的情況下發生.安裝前更新卸載后都沒有問題.

First of all: everything you will read in this post happens only if Windows 10 April 2018 update is installed. No problem before installation and after update uninstallation.

安裝 Windows 10 1803 更新后,我所有從網絡映射驅動器或 UNC 路徑運行的 VB 程序(VB6、.NET 和 WPF)都無法連接到 SQL 服務器,如果在本地放置并執行相同的可執行文件,則沒問題驅動器(在同一網絡中的 2 臺電腦上測試):

After installing Windows 10 1803 update, all my VB program (VB6, .NET and WPF) running from network mapped drive or UNC path can't connect to SQL server, no problem if the same executable is placed and executed from local drive (tested on 2 pc in the same network):

  1. 遠程 SQL 服務器,本地驅動器上的 exe:OK
  2. 相同遠程 SQL 服務器,映射網絡驅動器上的 相同 exe(具有完全讀/寫訪問權限):錯誤
  1. Remote SQL server, exe on local drive: OK
  2. Same remote SQL server, same exe on mapped network drive (with full read/write access): ERROR

這是錯誤(可能對解決此問題沒有意義):

This is the error (maybe not significat to solve this problem):

與 SQL Server 建立連接時發生與網絡相關或特定于實例的錯誤.服務器未找到或無法訪問.驗證實例名稱是否正確以及 SQL Server 是否配置為允許遠程連接.(提供程序:SQL 網絡接口,錯誤:26 - 錯誤定位服務器/指定的實例).

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

簡單的VB.NET代碼復現問題(將代碼放在一個簡單的形式,在button_click事件中加一個按鈕,設置值連接到SQL服務器,編譯,將exe文件保存在網絡路徑上并執行)):

Simple VB.NET code to reproduce the problem (place the code in a simple form with a button in the button_click event, set values to connect to the SQL server, compile, save the exe file on a network path and execute it):

Dim myConnectionString As String
Dim mySqlConnectionStringBuilder As New SqlConnectionStringBuilder()
mySqlConnectionStringBuilder.DataSource = myServer
mySqlConnectionStringBuilder.InitialCatalog = myDatabase
mySqlConnectionStringBuilder.UserID = myUtente
mySqlConnectionStringBuilder.Password = myPassword
myConnectionString = mySqlConnectionStringBuilder.ConnectionString

Dim mySqlConnection As New SqlConnection(myConnectionString)
mySqlConnection.Open()  <- error

異常:

System.Data.SqlClient.SqlException (0x80131904): Si è verificato un errore di rete o specifico dell'istanza mentre si cercava di stabilire una connessione con SQL Server. Il server non è stato trovato o non è accessibile. Verificare che il nome dell'istanza sia corretto e che SQL Server sia configurato in modo da consentire connessioni remote. (provider: SQL Network Interfaces, error: 26 - Errore nell'individuazione del server/dell'istanza specificata)
   in System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager)
   in System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   in System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   in System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   in System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   in System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   in System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   in System.Data.SqlClient.SqlConnection.Open()
   in RiepilogoOreTimer.RiepilogoOreTimerWindow.ConnessioneOK()
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:-1,State:0,Class:20

有什么想法嗎?

更新:如果我卸載 2018 年 4 月的更新,問題就會消失,即使在網絡驅動器上執行該程序也能正常工作,但這不能成為解決方案...

Update: If I uninstall the April 2018 update the issue go away and the program works fine even if executed on a network drive, but this can't be the solution...

2018 年 8 月 5 日更新:我注意到 2018 年 4 月的更新帶來了一些 安全變化:

Update 08/05/2018: I noticed that April 2018 update brought some changes in security:

Windows 10 版本 1803 提供額外保護:

Windows 10, version 1803 provides additional protections:

  • 新的攻擊面減少規則
  • 受控文件夾訪問現在可以阻止磁盤扇區

這可能是問題的原因嗎?我不是安全經理,所以我不能說這是否會導致我的問題

Could it be the cause of the issue? I'm not a security manager so I can't say if this can cause my problem

2018 年 9 月 5 日更新:我在 this 帖子:

Windows 10 更新 1803 無法打開網絡連接SMBv1 共享上的可執行文件(如 Windows Server 2003)

Windows 10 update 1803 does not open network connections on executables files on SMBv1 share (as Windows Server 2003)

但我不知道什么是 SMBv1...有人可以幫助我嗎?

but I don't know what SMBv1 is... somebody can help me?

推薦答案

終于發現問題了:在共享文件夾的服務器中,SMBv2被禁用(不知道為什么)所以只有SMBv1處于活動狀態;從同一網絡中的同一客戶端執行的同一程序但位于啟用了 SMBv2 的服務器上運行正常.

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.

所以問題是關于 SMBv1 共享,從 Windows 10 1803 開始??棄用

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

這篇關于如果從網絡路徑執行 EXE,則 SqlConnection 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應該使用什么 SQL Server 數據類型來存儲字節 [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否應該返回“1?什么時候不能投射為日期?)
Converting the name of a day to its integer representation(將一天的名稱轉換為其整數表示)
How to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中將 nvarchar m/d/yy 轉換為 mm/dd/yyyy?)
主站蜘蛛池模板: 黄石东方妇产医院_黄石妇科医院哪家好_黄石无痛人流医院 | 色油机-色母机-失重|称重式混料机-称重机-米重机-拌料机-[东莞同锐机械]精密计量科技制造商 | PCB接线端子_栅板式端子_线路板连接器_端子排生产厂家-置恒电气 喷码机,激光喷码打码机,鸡蛋打码机,手持打码机,自动喷码机,一物一码防伪溯源-恒欣瑞达有限公司 假肢-假肢价格-假肢厂家-河南假肢-郑州市力康假肢矫形器有限公司 | 高精度电阻回路测试仪-回路直流电阻测试仪-武汉特高压电力科技有限公司 | 哈希余氯测定仪,分光光度计,ph在线监测仪,浊度测定仪,试剂-上海京灿精密机械有限公司 | 测试治具|过炉治具|过锡炉治具|工装夹具|测试夹具|允睿自动化设备 | 空气净化器租赁,空气净化器出租,全国直租_奥司汀净化器租赁 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 【MBA备考网】-2024年工商管理硕士MBA院校/报考条件/培训/考试科目/提前面试/考试/学费-MBA备考网 | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 模具钢_高速钢_不锈钢-万利钢金属材料 | 数码听觉统合训练系统-儿童感觉-早期言语评估与训练系统-北京鑫泰盛世科技发展有限公司 | 苏州注册公司_苏州代理记账_苏州工商注册_苏州代办公司-恒佳财税 | 高温高压釜(氢化反应釜)百科 | 磁力抛光机_磁力研磨机_磁力去毛刺机_精密五金零件抛光设备厂家-冠古科技 | ISO9001认证咨询_iso9001企业认证代理机构_14001|18001|16949|50430认证-艾世欧认证网 | 浙江宝泉阀门有限公司 | 闸阀_截止阀_止回阀「生产厂家」-上海卡比阀门有限公司 | 亿立分板机_曲线_锯片式_走刀_在线式全自动_铣刀_在线V槽分板机-杭州亿协智能装备有限公司 | 上海单片机培训|重庆曙海培训分支机构—CortexM3+uC/OS培训班,北京linux培训,Windows驱动开发培训|上海IC版图设计,西安linux培训,北京汽车电子EMC培训,ARM培训,MTK培训,Android培训 | 干粉砂浆设备-干粉砂浆生产线-干混-石膏-保温砂浆设备生产线-腻子粉设备厂家-国恒机械 | 丽陂特官网_手机信号屏蔽器_Wifi信号干扰器厂家_学校考场工厂会议室屏蔽仪 | 山楂片_雪花_迷你山楂片_山楂条饼厂家-青州市丰源食品厂 | 铝合金线槽_铝型材加工_空调挡水板厂家-江阴炜福金属制品有限公司 | 没斑啦-专业的祛斑美白嫩肤知识网站-去斑经验分享 | 【直乐】河北石家庄脊柱侧弯医院_治疗椎间盘突出哪家医院好_骨科脊柱外科专业医院_治疗抽动症/关节病骨伤权威医院|排行-直乐矫形中医医院 | 骨密度检测仪_骨密度分析仪_骨密度仪_动脉硬化检测仪专业生产厂家【品源医疗】 | 密度电子天平-内校-外校电子天平-沈阳龙腾电子有限公司 | 苏州防水公司_厂房屋面外墙防水_地下室卫生间防水堵漏-苏州伊诺尔防水工程有限公司 | 厌氧反应器,IC厌氧反应器,厌氧三相分离器-山东创博环保科技有限公司 | 知企服务-企业综合服务(ZiKeys.com)-品优低价、种类齐全、过程管理透明、速度快捷高效、放心服务,知企专家! | 塑钢课桌椅、学生课桌椅、课桌椅厂家-学仕教育设备首页 | 国产液相色谱仪-超高效液相色谱仪厂家-上海伍丰科学仪器有限公司 | 微波萃取合成仪-电热消解器价格-北京安合美诚科学仪器有限公司 | 胶辊硫化罐_胶鞋硫化罐_硫化罐厂家-山东鑫泰鑫智能装备有限公司 意大利Frascold/富士豪压缩机_富士豪半封闭压缩机_富士豪活塞压缩机_富士豪螺杆压缩机 | RTO换向阀_VOC高温阀门_加热炉切断阀_双偏心软密封蝶阀_煤气蝶阀_提升阀-湖北霍科德阀门有限公司 | 宁夏档案密集柜,智能密集柜,电动手摇密集柜-盛隆柜业宁夏档案密集柜厂家 | 浇钢砖,流钢砖_厂家价低-淄博恒森耐火材料有限公司 | 南京展台搭建-南京展会设计-南京展览设计公司-南京展厅展示设计-南京汇雅展览工程有限公司 | 道达尔润滑油-食品级润滑油-道达尔导热油-合成导热油,深圳道达尔代理商合-深圳浩方正大官网 | 台湾阳明固态继电器-奥托尼克斯光电传感器-接近开关-温控器-光纤传感器-编码器一级代理商江苏用之宜电气 |