关于vb.net中的process.start [英] about process.start in vb.net

查看:149
本文介绍了关于vb.net中的process.start的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vb.net windowsforms中有一个应用程序.在该应用程序中,很少有链接的路径来自访问数据库的链接.根据单击的链接,相应的应用程序将打开.在路径中有不同的应用程序,例如.txt文件.xls文件和mdb文件等.问题是,当我单击mdb文件的链接时,它会第一次正确打开.当我第二次打开它时,不会关闭打开的mdb. System.dll中发生了类似''System.ComponentModel.Win32Exception"的错误.并且仅在mdb文件中才发生.为什么会发生这种情况.我不能使用process.start打开mdb文件两次?

i have an application in vb.net windowsforms. in that the app there are few links whose paths come from access database. depending upon the link clicked the corresponding application opens. there a different applications in the paths like .txt files .xls files and mdb file etc. the problem is when i click on link of mdb file it opens for 1st time correctly.without closing the opened mdb when i open it 2nd time its giving a error like this"''System.ComponentModel.Win32Exception'' occurred in System.dll".and it is happening only with mdb files. why is this happening.cant i open the mdb file twice using process.start?

推荐答案

这不是Process.Start问题,那是设置为MDB文件默认值的任何应用程序都拥有对该文件的独占访问权-这是有道理的,并且在多用户环境中使用时,MDB文件非常垃圾,除非由SQL Server之类的东西打包.

首次使用Process.Start打开它时,应用程序运行,打开文件,并使用排他锁将其保留,以防止其他程序在使用它时对其进行更改.然后,当您尝试在同一文件上使用Process.Start时,同一程序将再次运行,尝试打开该文件,然后由于使用中的文件而失败.
It''s not a Process.Start problem, it''s that whatever application you have set as the default for MDB files is holding exclusive access to the file - which makes sense, and MDB files are pretty rubbish when used in a multiuser environment, unless packaged by something like SQL server.

The first time you open it with Process.Start the application runs, opens the file, and holds on to it with an exclusive lock to prevent other programs changing it while it is using it. When you then try to use Process.Start on the same file, the same program runs again, tries to open the file, and fails because it is in use.


这篇关于关于vb.net中的process.start的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆