Solving path access denied error in windows form app - vb.net

I used installShield LE 2015 to build my application's installer and is successful. The problem am having now is that there's a Ms access db file in the installation location which i need to restore from the main application, but when i try to restore it, i get an error "Access to the path "C:\Program Files (x86)\RC record system\RecordSystemDb.accdb" is denied. Please someone should tell me how to resolve this issue.

Related

Inno setup - how to set installer "Run as non Admin"?

I would like to run installer with no admin privileges.
But when i would like to run my created .exe file, this error message appears:
Unable to execute file in the temporary directory, Setup arborted.
Error 1260: This program is blocked by group policy. For more information, contact your system
administrator.
Is ist possible to fix this problem in the inno setup script?

Module comctl32.ocx failed to load in Windows 10 Home

I have an old VB 6 app that someone is trying to install. The user is trying to register Comctl32.ocx. The file is in C:\windows\system32. The user has Windows 10 Home. When trying to register using:
Regsvr32 c:\windows\system32\comctl32.ocx
The user gets the message:
The module "comctl32.ocx" failed to load. Make sure the binary is
stored at the specified path or debug it to check for problems with
the binary or dependent .DLL files. The specified module could not be
found.
Any ideas what the user can try?
See https://support.microsoft.com/en-us/kb/249873
Basically: You are trying to register from the wrong directory, 32 bit OCx must be in c:\windows\syswow64
Also make sure you execute that command from an elevated command prompt (Admin).

Could not load file or assembly 'microsoft.visualstudio.shell.ui.internal' or one of its dependencies. SQL Server 2012

My SQL Server 2012 suddenly stopped working here is all I got in popup message:
could not load file or assembly 'microsoft.visualstudio.shell.ui.internal' or one of its dependencies. An attempt was made to load a program with incorrect format.
I have Repaired using installation CD but no luck.
I had the same problem and fixed by uninstalling the Visual Studio 2010 Shell and installing back. Simply reinstalling doesn't work.
1. Download the Visual Studio 2010 Shell: https://www.microsoft.com/en-us/download/details.aspx?id=1366
2. Run the exe file and click uninstall(or remove).
3. Run the exe file and click install with default settings.
After these steps the Management Studio will work just fine.
I got this error in VS2013 when reparing in the logfille,
[113C:2588][2018-01-20T16:41:54]i000: MUX: ExecuteError: Package (vs_minshellcore) failed: Error Message Id: 1305 ErrorMessage: Error reading from file C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.UI.Internal\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.UI.Internal.dll. Verify that the file exists and that you can access it.
and I check the file is exist, and I modify its access authority to complete control to every user account, but this error still occur,
Finally I delete this dll, and find same dll in another Normal Computer with VS , and copy the file paste to the problem computer, and run repair again then pass.
Share my works Microsoft.VisualStudio.Shell.UI.Internal.dll in Here.
But in my case after repair success, vs2013 still got error when opening, so I finally give up and turn to use vs2015, which luckly can work. It is a strange problem.
have this problem also with vs2019 community. I was trying to create the first 2019 project after it is installed. Then I got this. I ran the install exe file, vs_community.exe again in order to repaire it. But I found out that the install program request to restart the pc to finish the last step. Actually I restarted the pc afterwards manually. But I still did it by clicking on the button "restart pc". After the pc is restarted, the problem is gong. I can create project without any error.

"Access to this path is denied" in Windows 7 application

Ran into a strange phenomena:
in Application A, the code:
Using sr = New StreamReader(path)
runs perfectly (where path is C:\tmp for example. The directory is on the local machine).
In Application B the same line, on the same directory throws the exception: "Access to the path is denied".
This happens when run in the IDE or by activating the exe file.
Some additional information:
Windows 7 Pro, 64bit VS 2013
The app.manifest of both application is identical. I've tried changing to all possible options of requestedExecutionLevel but the result was the same.
The target framework of the application is 4.
The exception is thrown whether I run as administrator or not.
I've set the permissions of the directory to full control for all accounts (including Administrator and Everyone).
I've deleted the directory and recreated it. Didn't help.
Ran Farbar scan which did not report any problems.
Application A is referencing the FILE C:\tmp. I expect this file isnt present on Application B's machine.
http://msdn.microsoft.com/en-us/library/vstudio/f2ke0fzy
Also ensure you are properly disposing of your StreamReader class after use. if you dont do this the file can remain locked.

sp_attach_single_file_db Error: failed with the operating system error 5(Access is denied.)

I'm trying to use this DataBase that come with this sample project with from MS:
http://code.msdn.microsoft.com/ASPNET-Web-Forms-6c7197aa/sourcecode?fileId=18930&pathId=365206059
So after I downloaded the files: I need to attach the .mdf DataBase to my Instance of MS SQL 2008.
From Management Studio Attaching DataBase does not work and event using this command i receive the same error:
sp_attach_single_file_db 'School.mdf', 'C:\School.mdf'
ERROR:
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\School.mdf" failed with the operating system error 5(Access is denied.).
Any idea what is wrong? Thanks for your help!
Give full permission on folder in which you want to create the mdf file
to the logon account with which the SQL Server service is running.
Usually: NT Service\MSSQL$
You can look that up
Control Panel-> Administrative Tools-> Services=> SQL Server -> Prperties-> Logon Tab-> Note the account
What operating system are you running on? Did you get an elevation prompt when you saved the file to the root of the C drive? What user account is SQL Server running under, and does it have permissions to read any files in the root of the C drive?
You might do better placing the file into %ProgramFiles%\Microsoft SQL Server\MSSQL10.<instance name>\MSSQL\DATA, alongside the other .mdf files that you know it can already read (adjust path above as necessary, but you hopefully get the idea).
I had this issue and all the solutions online was misleading.
The solution was to open SSMS as Administrator. In my opinion first try this and later try all other solutions.
Moving it to DATA folder basically resolved permission issue. Another solution is to change the permissions of the file (or files) and thus still have DB in different folder. I just ran into similar permission error "CREATE FILE encountered operating system error 5(Access is denied.)" trying to attach DB in SQL Server 2012 express on Windows 7.
Solution I did was following:
1) Rich-click on each MDF, LDF, and NDF file to get menu --> select properties
2) Add Users for computer and give them full control (instead of Everyone - to dangerous)
After that I could attach the DB.
However, even if not moved to DATA folder, should move into subfolder instead of C:\ root (example: C:\mydb).
create DATABASE newDataBaseName
on (FILENAME = 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\filename.mdf'),
(FILENAME = 'C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\filename_log.ldf')
FOR ATTACH_REBUILD_LOG;
GO
Also as Damien mentioned above put the mdf files in the where your other mdf files are located. For me C:\Program Files (x86)\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA
In my case I found the Directory lookup needed the computer/users group in read/list permissions. While the service and the actual user running the (in my case) restore had full permissions that permission was important.
Security wise I hate it.