找不到文件'C:\program files\ business unit\ajiboye\buthdatabase.accdb'。 [英] Could not find file 'C:\program files\the business unit\ajiboye\buthdatabase.accdb'.

查看:100
本文介绍了找不到文件'C:\program files\ business unit\ajiboye\buthdatabase.accdb'。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用vb.net构建我的项目之后,我启动它但是每当我尝试保存数据时它都会给我这个错误'找不到文件'C:\Program Files \ The Business Unit \ Ajijoye \\ \\ Buthdatabase.accdb'。



我尝试过:



拜托,我不知道该怎么办。请帮我解决问题。谢谢

after building my project with vb.net, i launched it but whenever i try to save a data it will give me this error 'could not find file 'C:\Program Files\The Business Unit\Ajiboye\Buthdatabase.accdb'.

What I have tried:

please i dont know what to do to this. kindly help me out with the solution. thank you

推荐答案

这不是我们可以解决的错误 - 我们无权访问您的代码或您的硬盘。



错误消息说明问题所在:它无法找到文件。据推测,您可以在应用程序的某个位置引用此文件。如果文件实际上不存在,请将路径更改为存在的文件。如果该文件已存在,请确保您对该文件具有必要的权限。
This is not an error we can fix - we don't have access to your code or your hard drive.

The error message tells what the problem is: it can't find a file. Presumably, you refer to this file somewhere in your application. If the file doesn't actually exist, change the path to a file that does exist. If the file does already exist, make sure you have the necessary permissions on the file.


为了在代码中使用Access数据库,该文件必须位于用户拥有的文件夹中READ和WRITE权限。 Program Files下的任何文件夹对用户都是READONLY。他们不会对Program Files下的任何文件拥有WRITE权限。



您必须将数据库文件放在用户具有WRITE权限的文件夹中,例如所有用户的CommonAppData在机器上。



您可以使用 Environment.GetFolderPath() [ ^ ]并指定 CommonApplicationData枚举 [ ^ ]。



一旦你有了这条路,就可以用< a href =https://msdn.microsoft.com/en-us/library/fyy7a5kt(v=vs.110).aspx> Path.Combine() [ ^ ]构建数据库文件的完整路径。
In order to use a Access database in your code, the file MUST be in a folder that users have READ and WRITE permissions to. Any folder under Program Files is READONLY to users. They will not have WRITE permissions to any files under Program Files.

You have to put the database file in a folder users have WRITE permissions to, like CommonAppData for all users on the machine.

You can get the path to this folder using Environment.GetFolderPath()[^] and specifying the CommonApplicationData enum[^].

Once you have the path, you can use Path.Combine()[^] to build the full path to the database file.


这篇关于找不到文件'C:\program files\ business unit\ajiboye\buthdatabase.accdb'。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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