Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 17-Aug-17 3:09am

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.
 
Share this answer
 
Comments
Member 13341316 17-Aug-17 5:30am    
the file already exist, but i dont know how to give necessary permission. please is their a way i can send the project to you so that you can see
Thomas Daniels 17-Aug-17 5:42am    
One option is to run your application as administrator, another option is to place the database file in a folder where you don't need administrator permissions (such as AppData). I recommend the second option.
Member 13341316 17-Aug-17 6:28am    
when i tried the second option i get the following errors: Error 6 Unable to open file 'C:\Users\teejayfpi\Desktop\BOWEN DATABASE\WindowsApplication2\WindowsApplication2\obj\Debug\WindowsApplication2.StartUpPage.resources': System Error &H80070002& WindowsApplication2

Error 1 Resource file "StartUpPage.resx" cannot be found. WindowsApplication2

Error 5 -6417: Internal build error ISEXP : error : -6417: Internal build error

Error 4 -6271: File C:\Users\teejayfpi\Desktop\BOWEN DATABASE\WindowsApplication2\WindowsApplication2\bin\Debug\WindowsApplication2.exe not found. An error occurred building the MsiFileHash table record for this file. Verify that the file exists in the specified location. ISEXP : error : -6271: File C:\Users\teejayfpi\Desktop\BOWEN DATABASE\WindowsApplication2\WindowsApplication2\bin\Debug\WindowsApplication2.exe not found. An error occurred building the MsiFileHash table record for this file. Verify that the file exists in the specified location.

Error 3 -6103: Could not find file "C:\Users\teejayfpi\Desktop\BOWEN DATABASE\WindowsApplication2\WindowsApplication2\bin\Debug\WindowsApplication2.exe" ISEXP : error : -6103: Could not find file "C:\Users\teejayfpi\Desktop\BOWEN DATABASE\WindowsApplication2\WindowsApplication2\bin\Debug\WindowsApplication2.exe"
Thomas Daniels 17-Aug-17 6:37am    
Those errors seem to be unrelated to the database, but they also aren't really errors that I can help with because only you can access your project (and it seems pretty big, so I'm not really interested in receiving it to look into it myself). Read the error messages and Google for clarification if necessary.
Member 13341316 17-Aug-17 7:00am    
but the error started showing after i put the accdb file into folder
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900