I can't save a VISIO .vsd file on my C Drive from Visual Studio? - vb.net

The following occurs when I try to save a VISIO file to C:\SimpleFlowchart.vsd via visual studio.
I used the <DispId(13)>
Function SaveAs(FileName As String) As Short
Command
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in VisioTestApp.exe

Current versions of Windows really don't like it when you save stuff to the drive's root directory. If you can't save it in your Users folder, then at least make a temp directory off of C: and save it there

Related

Update SQL Server connection string on VB.NET EXE without source code

I have a really old application that was created using VB.NET. The original source code has since been deleted and unrecoverable. I have to change the database location and need to update this in the application. I changed the connection string in the .config file, but it seems to be getting it from the exe itself. If I open the exe file in Notepad++ I can see the original connection string. If I edit the file and save it, it no longer works. I get an error saying: "This app cannot run on your PC".
I tried opening the app with Resource Hacker, but don't see the connection string to update. I have Visual Studio 2019 and tried opening the exe file, but also don't see anywhere to edit the connection string.

Essbase dataload error

I'm on a Windows 10 box using Oracle Essbase Admin Services console 11.1.2.4. When I load data I get an error. My problem is that the dataload.err file will not write to my c:\ drive or any network drive to which I have access. If I manually create the dataload.err file in Windows Explorer and run the load data process, I can watch the dataload.err file disappear. I've tried a different file name and different directories, but it won't save.
Why won't the dataload.err file save? Any help would be greatly appreciated.

Error in reading pdf file

we made one application to read the pdf file and write in Excel.We used iTextSharp.dll.
Application works fine here with windows XP as well as WIndows7.We created this using applicaiton in VB.net in VS2008 version.we have Adobe ReaderX.
But for our customer its not working and it shows error as Unhandled Exception and shows error as
filename.pdf not found as file or resource.
Whats reason for this error message.Customer PC is Windows7 and AdobeReaderX is installed there.
Pls kindly help me.
Random guess? Some directory or filename information is hard-coded into your application. Or the customer is trying to open an incompatible file. Like trying to open a text file with the paint application.

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.

Microsoft Office Excel cannot access the file

I have create Office Excel application in my machine(XP). and i have placed the application in windows server 2008 giving the following error.
Microsoft Office Excel cannot access the file '\server\Input.xls'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.
both client and server systems installed office 2007 and added reference microsoftexcellibrary 12.0
created assembly for the application and calling the code from the form.
I was getting the exact same error, although in my case I was trying to run (from Tidal Enterprise Scheduler) a .NET app that used microsoft.interop.excel.
The answer is already in stackoverflow:
[Microsoft Office Excel cannot access the file 'c:\inetpub\wwwroot\Timesheet\App_Data\Template.xlsx'.
I'll re-list the steps from that link:
Create directory “C:\Windows\SysWOW64\config\systemprofile\Desktop” (for 64 bit Windows) or “C:\Windows\System32\config\systemprofile\Desktop” (for 32 bit Windows)
Set full control permissions on Desktop directory above (for example in Win7 & IIS 7 & DefaultAppPool set permissions for user “IIS AppPool\DefaultAppPool”)
Of course, if you're running a scheduled task rather than WebApp, you'll need to make sure the service account you're using has permissions on that folder.
I had the same error when trying to save to:
C:\test.xlsx
When attempting to save to the root directory, it seemed to cause problems. Changing my path to:
C:\MyExcelTests\test.xlsx
Worked fine
I would make sure no Excel processes are running on the machine before you run this application, that should cover the last point.
The first point looks the most likely issue, the path looks like a partial path or an incorrect UNC path. Try putting the full path to the spreadsheet 'C:\server\input.xls' and see if that works.
To stop the middle point, in the workbook.open command you can specify to open as read-only, this will make sure the application can red the file even if it is locked open by another user.