Issue adding a Access File as a Data Source in Visual Studio - database

Good evening,
I seem to be having an issue with adding a Access Database as a Data Source in my Visual Studio project. When I launch the New Data Source wizard and go through the first two steps I land at the 'Choose Your Data Connection' window, where I have to choose 'New Connection...'. Once this window has opened I choose the first option which is 'Microsoft Access Database File' and this is where I'm having my issue. It seems the way that it is supposed to work, and how it works for everyone I know, is that it is supposed to open a New Connection window similar to this:
(This is a screenshot I grabbed off Google as I cannot actually get to this step, I realize it's an old photo but this is generally what I'm supposed to see)
First Screenshot
What I actually get is this:
Second Screenshot
And that's where I'm stuck. Any ideas?
Any help is appreciated. Thanks.
Andrew

If anyone else has this issue, running the Windows System File Checker tool seems to repair it. To run, open a command prompt as administrator and type:
sfc /scannow
Once that completes (it may take a while), reboot and you should be good to go.

Related

Visual Studio Code opens multiple instances

Two days ago I installed Visual Studio Code and it worked pretty fine. But now as I am opening Visual Studio Code it's opening multiple instances, how can I solve it..??
Edit: it seems Visual Studio Code opens every file present in the directory in another window how can I solve that..??
I had similar problems as well (SECOND ACTION - in my answer should solve your problem). My system was suddenly "laggy" as well, with no prior sign of significant damage. My windows self-restarted on its own, attempting to fix the problem but still didn't resolve it. When I use the command:
code .
in the comand line to open a folder in visual studio code (vscode) editor, it opens multiple instances of windows tab. Below is how I tackled the two problems:
Two things (Actions);
FIRST ACTION: (targeted: Laggy windows OS)
I used the command prompt(in Admin mode) to run the command: ”
sfc /scannow
This action fixed some corrupt system file and solved the laggy nature. I noticed significant improvement, possibly restoring it to previous performance level.
Check the Microsoft docs for more info.
SECOND ACTION: (Visual Studio Code opens multiple instances - should answer your question)
Open vscode editor, go to the setting and paste this in the search bar:
"workbench.editor.enablePreview": false
If you have this option marked, you should unmark it or set it to false depending on the interface you are presented and interacting with. This should stop vscode from running multiple instances and hopefully resolve your problem.

My installed WPF app is crashing while trying to create a file

I have a problem with my WPF application (a simple clicker game). I've just made a deployment/created a setup project using Microsoft Visual Studio Installer Projects extension for Visual Studio. Everything seemed to work fine, setup works good (tested on other computer) and furthermore the installed application almost works correctly. The only exception is a button calling function which is creating a new txt (something like a draft of a "save" file) file in a folder where the application is installed. Clicking this button cause instant crash of the whole application. Nothing else happens, no error message, the app just turns off.
I assume that the problem lies in access rights to the folder/administrator rights.
I've added txt file with the same name in the application folder using "File System" window in setup project, deployed and installed again. Even when the file exists the problem happend again (probably because of access rights when trying to override file content).
It's may be important that everything worked while running app through VS, also using .exe works fine on any computer. The problem is only with application installed using setup.
I'm not sure where the problem is so it's hard to show some code, to be honest i'm not even sure if it's a problem with code, maybe it can be solved with setting some setup project properties?
I would like to store some data locally between two sessions, i've choosed txt file because it's light and simple even if it's not the most elegant way.
I expect that installed application will be able to create and override txt file in it's folder.
P.S. if you need any code, screenshots or information about my setup please let me know in comments section, I will provide what's necessary
At the moment you install your program you're having administrator-rights. So the folder where your application is, also was created with administrator-rigths.
If you want to store data to this folder, you'll have to run your application as administrator. (not the best idea)
Otherwise you can change your code to write your file at runtime to a different location where you don't need administrator-rights.
For example:
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
will give you: "C:\Users\MyUserName\AppData\Local"
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
will give you: "C:\Users\MyUserName\AppData\Roaming"
string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
will give you: "C:\Users\MyUserName\Documents"
And some error-handling around the saving of the file would be very nice and helpful ;)
Thank you everyone for solution and knowledge, the problem was as I assumed (access to the path denied).
I was using this code to create a path:
Directory.GetCurrentDirectory() + "\\SyntyhCitySave.txt";
Creating a file in a special directory instead of application folder works, that's the solution for my problem:
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\SyntyhCitySave.txt";
Tomtom answer marked as accepted.

Every action I take, Visual Studio opens up the 'save file as' dialog

Whenever I try to debug and/or run in VS2015, a 'save file as' dialogue opens up. not knowing what to do my first thought is to exit and reopen, but when I try to save the project first, again the dialogue appears! when I try to cooperate and save it under that file name a message appears saying this file already exists and when I try to replace it an error dialogue appears saying the file is being used by another process.
I have tried:
open VS prompt --> devenv /ResetSettings
run as administrator
clearing ReSharper cache
Nothing worked.
Help would be very much appreciated
Update: after clearing ReSharper cache it seemed like the issue was solved, but it wasn't. I can't point out when exactly it happens. it feels like this happens randomly.
Problem solved by closing Google drive.
I deleted the file that I was being asked to save it and resaved it (created it) or something and it worked. The file was Form1.cs.

Visual studio debugging starts but application doesn't

So, the problem that I am having is that when I push F5, or click Start, Visual Studio starts debugging, but the application doesn't actually build. If I go to my Task Manager, and look for the process it isn't there. Or, if I alt-tab between the programs I had open. I have had this problem twice now. The last projet I started, I encountered this problem. I spent days looking for answers on my time off but couldn't find anyhting. So i started a new project. And now I'm getting the same thing. If I go to my source tree and go back to a previous build and discard my changes, it works fine. But the problem comes back. Its not my coding. I am not getting any build errors. And I don't have any break points. So i can't hit continue. PLease alos note, that between it working, and not working I have not changed ANY setings in Visual Studio. I will post what I have tried. If I forget anything, please forgive me. I have days and days of history to go through in my browser.
Restarted Computer and VS
Ran VS in Admin
Always Build is selected in Tools -> Options -> Projects and
Solutions -> Build and Run
Make sure project is set to Debug in Solution Configuration and
Build is checked in Configuration Manager.
Make sure Only BUild startup projects and dependencies on run is
unchecked
Clean Solution
Unchecked Enable the Visual Studio hosting process in Project ->
Properties -> Debug tab
Made sure vshost32.exe was not running in the background while
program was not running in the Task Manager.
Deleted contents of bin and obj files in my project folder file and
reset computer.
Tried running the program from the exe in previously mentioned
bin/obj file. (The last one does start the process in Task Manager. But still doesnt show in the task bar, or alt tab.)
None of these have worked. I am getting very frustrated at this. Maybe I am not looking for the right thing in Google...
I suggest you close all third party tools/processes like the Anti-virus or others, and then re-debug it.
Or
You could run your VS in safemode:
devenv /SafeMode
Some community members found that the symbols loaded is really slow recently, and this issue has been report the Microsoft product team, so please also disable the Microsoft symbols server under TOOLS->Options->Debugging->Symbols. Debug it again.

MS Access97 Run Time Error 2447

Someone left a system using MS Access97 and I dont have any idea on how to use access97 since it is my first time using it.
I installed a Microsoft Access97 to a new computer then try to open the system but it displays an error "Run Time Error 2447 There is an invalid use of the .(dot) or ! operator or invalid parenthesis". However the old computer can open the database without any error. I am really confused about this scenario. Can anyone help me?
Open the code editor. Go to menu Tools, References and check that no reference is prefixed MISSING. If so, resolve it.
In any case, go to the menu and select Compile and save all modules.
If some ocx or third-party control is installed and used on the old computer, you must install these on the new computer as well.

Resources