简体   繁体   English

MS-Access用户无法访问链接的文本文件

[英]MS-Access users can not access linked text file

I have a small Access database that is distributed amongst several users. 我有一个分布在多个用户之间的小型Access数据库。 They are not on my network, so we set them up with a small Access database that links to a txt file that we send them, so they have the ability to run canned queries/reports (that are just a copy of our main database's reports). 它们不在我的网络上,因此我们用一个小的Access数据库进行设置,该数据库链接到我们发送给它们的txt文件,因此它们具有运行罐装查询/报告的能力(这只是我们主数据库报告的副本) )。

The problem is that if two users try to run reports (there is only one source table - the linked text file), then one of them gets locked out. 问题是,如果两个用户尝试运行报告(只有一个源表-链接的文本文件),则其中一个将被锁定。 We checked the folders and everyone has read/write access to the folder (but again we're just reading the text file, so does it matter if they have write access?). 我们检查了文件夹,每个人都对该文件夹具有读/写访问权限(但同样,我们只是在读取文本文件,因此,如果他们具有写访问权限,这有关系吗?)。

Does anyone know why this is happening? 有人知道为什么会这样吗? Does Access automatically make a link to an external text file exclusive? Access是否自动将指向外部文本文件的链接排他?

I finally just created a linker.MDB that will sit on the same shared folder as the data.TXT file at the client's location. 我终于创建了一个linker.MDB,它与客户端位置的data.TXT文件位于同一共享文件夹中。 (I don't have access to their network, and relying on my contact to place files where they need to go). (我没有访问他们的网络的权限,只能依靠我的联系人将文件放置在他们需要去的地方)。

When the user opens their client.MDB file on their local PC, it will have a link to table on the linker.MDB, called "dailydata" 当用户在本地PC上打开他们的client.MDB文件时,它将具有指向链接器.MDB上表的链接,称为“ dailydata”

Also, their client.mdb will run code to open the linker.MDB database, run the following to import the txt file, and then close the linker.MDB database. 同样,他们的client.mdb将运行代码以打开linker.MDB数据库,运行以下命令以导入txt文件,然后关闭linker.MDB数据库。 This ensures that the data in the linker.MDB is always up to date with the latest. 这样可以确保linker.MDB中的数据始终是最新的。 I may play around with the date attributes to only let the first call import the text file, but we'll see. 我可能会使用date属性,只允许第一个调用导入文本文件,但是我们会看到的。

strPath = CurrentProject.Path

strFullName = strPath & "\data.txt"

strTable = "dailydata"

DoCmd.TransferText acImportDelim, , strTable, strFullName, True

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM