English 中文(简体)
如何确保网络驱动与申请挂钩?
原标题:How to ensure network drives are connected for an application?

I have a desktop Windows application that is installed in small office environments.

申请使用<代码>。 MDB database file as its database which is Deposit on a web Drive.

Configuration files specify the path of the .MDB file on the server using a letter drive: eg. f:datadb.mdb

申请一开始便可查阅该数据库档案。 在申请启动时,我如何确保网络驱动力是连接的,也是可以进入的?

有时,Windows don t relink网络驱动器和连接网络的唯一途径是把双轨制放在我的计算机上,即便在绘制运动图时,“在标识上重新连接”也作了计算。

解决办法是使用<条码>/机关-名称<>/条码>而不是驱动信件?

最佳回答

您询问,“是否解决办法是使用机器——名称共享而不是驱动信件?”

我认为,这是肯定的。 UNC道路避免了2个问题:

  1. share not connected to a drive letter
  2. share is connected, but mapped to a different drive letter than you expect

不详的是,在你的申请中,是否有任何东西使多边开发银行成为一种复杂或完全摆脱交易的通道。

问题回答

你们应该利用联合国中心的道路,因为并非每个人都会把你的努力推向同一封信。

Determine UNC path

首先,我将确定联合国计算机中心在:数据db.md上的当地计算机上所存在的道路。 采用此处发现的一种技术:

基本上,你看视视窗探索者如何列出网络地图化驱动力,然后利用这一方式来推展UNC的道路。

Check Availability using WMI

假设这一驱动力实际上在计划使用该应用程序的每一家当地计算机上进行测绘,使用,Win32_MappedlogicalDisk par 来确定地图上网络的可用性。

http://www.jpsoftwaretech.com/vba/using-wmi-services-in-vba/drive-information- local-network-mapped-drives/“rel=”>here。 可加以调整,以确定是否有特定的网络驱动力(排入节)。 查阅<代码>.ProviderName,以适应UNC的道路,因此,你知道哪些是正确的驱动力,然后检查<代码>.Availability的价值,以确定能否利用所绘制的网络驱动力。

您应明确放弃网络驱动绘图的可能性:

  • using this technique forces you to manipulate physically each computer using your db, where you have to assign a letter to the network drive.
  • every computer user can easily change it
  • any disconnection from the network might force the user to manually reconnect to the disk drive

尽管你处于一个领域,但我不建议你使用一个名字,因为出于多种原因,计算机不一定总是很容易在网络上找到,特别是在其IP经常发生变化的时候。

您无疑应当找到一种办法,把固定的知识产权安排到您的磁盘上:这是你可以想象的最稳定和最长久的解决办法。 • 贵域管理人为您作出安排。

然后可以非常容易地测试你的网络磁盘。 有许多解决办法,包括试图直接打开 m子。 你还可以测试档案的存在(通过文件反对我的想法),或甚至使用你可以从你的代码上推出的任何外部方案或窗口。 请奥古格尔·博克测试IP,或类似于在方便时找到解决办法。

EDIT:窗户甚至建议仿照某些VB代码。 查询here

EDIT2:我发现,我用我的一份手法,允许在你网络的某个地方(并且可以接触巴)立案时进行快速检查。 如果能够提供新的用户界面版本,则基本上将进行测试。

Function fileIsAvailable(x_nom As Variant) As Boolean

On Error GoTo ERREUR
Application.Screen.MousePointer = 11

Dim fso as object
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(x_nom) Then
    fileIsAvailable = False
Else
    fileIsAvailable = True
End If
Set fso = Nothing

Application.Screen.MousePointer = 0
On Error GoTo 0
Exit Function

ERREUR:
Application.Screen.MousePointer = 0
debug.print Err.Number, Err.description
End Function 

你们可以通过提供你的网络名称,如:

if fileIsAvailable("\192.168.1.110myFileName.mdb") then ...

You did not make it clear what your application was written in, however before you attempt to connect to the database for the first time, presumably in a splash screen or something of that nature, check that f:datadb.mdb exists.

在申请开始之前,确保这一文字正确:

net use f: \machine_nameshare /user:[username] [password] /persistent:yes

这将勾画你具体写的信中的摊销。





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

access query to filter and combine count

i have two access tables tableA num count 1 7 2 8 3 9 4 9 5 13 6 6 tableB num count 0 1 1 14 2 12 3 5 4 5 5 11 6 5 how can i create an access query that ...

How to show File Picker dialog in Access 2007?

I want to show a dialog where the user can pick a file, click OK, and then the path to the file will be saved in the database. I have just one problem, I can t figure out how tho show the dialog ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

Returning row number on MS Access

I have 4 tables, from which i select data with help of joins in select query...I want a serial no.(row number) per record as they are fetched. first fetched record should be 1, next 2 and so on... In ...

热门标签