your network access was interrupted access to continue close the database - c#

i created a windows application using c# and vs2008 and access2007 database .the program runs properly in my computer but when the setup is installed in the client system i get the error "your network access was interrupted access to continue close the database "

Thoughts:
Assuming the access2007 database is on a network drive... Is the drive mapped to a drive letter? If so, does that drive always show up 'enabled', or does it ever show 'disconnected'?
Is more then 1 user trying to access the DB at the same time. Usually only one user is allowed read/write access, making Access databases unpractical sometimes.
Does the Client have a wired connection? Does the network connection appear to perform well (when doing other things)?

Yesterday I faced this same problem, and I was not able to find anything useful in the Internet. I got it SOLVED! so I write here to share my case and solution:
The reason why I was getting this misleading error message was THE USER running my application: My application is a SERVICE, so user is not the one logged on the computer, but, according to the task manager, user is SYSTEM.
My service is written in Java, and it was trying to connect to a MS Access 2007 .accdb database, getting the error message "Your network access was interrupted. To continue close the database and then open it again".
If I run my service changing "log on as" from "local system account" to "this account" and I enter the user & password used to log on Windows, the problem disappears! As you see, it has nothing to do with closing database and opening it again, and it has nothing to do with network access interruption. An ERROR_ACCESS_DENIED (0x5) would have been much much clearer... ;-)
I hope this hint helps...

Related

BrowserStack Selenium local authentication dialog

We're trying to use BrowserStack in local mode to hit our AUT on our internal network. I've got it configured so that I'm getting the remote browser session, but as soon as I try to direct it to our app's (or any) URL within the firewall via Chrome, the browser throws up a dialog complaining that the connection is not private and asking for a user name and password. This is not a normal pop-up and we can't automate it with Selenium, so it stops us dead.
When accessed via a desktop browser session the system knows who I am and opens for me with all appropriate permissions etc. It doesn't know who... or what... is coming through the remote session, thus the requirement to authenticate, I guess?
We see slightly different behavior with Edge: No pop-up, it just clocks until time-out. OTOH, if I just try to launch Edge in BrowserStack Live, I get a message saying "If you're behind a corporate firewall, disable SSL inspection for *.browserstack.com", and then I get thrown out.
I've been scouring everything I can find about local to see if there's some way I can create the remote session with an 'identity' (I'm talking network identity, not B'stack user name/access key) and all I'm finding are things that pertain to proxy servers. As far as I know, there is not a proxy server at play here, so I'm really kinda up in the air.
Are there folks with experience with B'stack local mode who might be able to provide some insight?
rabbit
If you don't have the local binary downloaded and running on your machine...it could cause this to happen.
You can download it here:
https://www.browserstack.com/local-testing/automate#command-line
After you have it unzipped on your local machine...open up terminal:
./BrowserStackLocal --key yourkeyhere
Once it is running on your local machine, try to open up BrowserStackLive and run your manual tests.
Are you also having issues with automated tests not completing or just the manual testing of the website?

Counting all instances of a .exe running on a shared folder

I have a c# application that is on a shared folder in which I have 3 or 4 people who all run the same .exe file. I need to be able to count all instances of the running process.
So far I've tried mutex and:
Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length;
those work if I'm trying to compute the number of instances of the .exe file I have running on my machine, but this will be running on multiple machines all pointing back to the same shared executable.
I don't want to create a file that increments and decrements depending on if a user opens or closes it for that would be unreliable.
--------edit--------------
Does anybody know how Excel does it? If the 2nd person opens the file it says that it is in use and tells you who is using it
Thank you for your help!!!
There isn't any way other than to implement some form of a licensing service or if you have privileges to the running machines.
You can tell who has a share open:
open computer management (right click my computer and select manage)
then from the tree view on the left select:
system tools> shared folders> sessions
this lists who is accessing files through shares.
there is an SO answer about sdoing this programatically:
https://stackoverflow.com/a/2418657/359135
If you really wanted to take it further and you have the admin rights you could use this info to interrogate running processes on connected machines:
tasklist.exe /S SYSTEM /U USERNAME /P PASSWORD
http://www.watchingthenet.com/how-to-view-and-kill-processes-on-remote-windows-computers.html
I am not suggesting you do any of this.. more to highlight what would be required. I would run a server somewhere that received a open, close and ping notification from your app.
the ping notification would let you identify instances that had crashed, lost connectivity or for any other reason not sent a close notification to the server app.
I have seen this done just by having a table in a DB of open session that gets written to every minute or so. I don't know how this would work for millions of users but i have seen it working well for tens of users (up to about a hundred).
EDIT:
more on pinging..
if you have server side code you can actively look for missing pings, however I would be tempted to just use a DB table and add a where clause to your select when reading open sessions:
Select
*
FROM
Session
WHERE
LastPing > DATEADD(second,-60,Now())
and I would check for an old record on insert, so that you don't get lots of old rows hanging around.
EDIT: just to be clear if you used the crazy techniques listed at the start of this answer you would have no way of knowing that someone had copied the file to their machine locally and run it. If you make the program insist that it has a connection to a particular DB or server then you have much more control.
A process on one computer cannot detect processes running on a different computer unless you set up some kind of communication between them.
You could set up a shared file as you suggest, but yes it will be unreliable.
You could run a service on some central computer and each instance has to report back to the server, but of course that will have similar reliability issues. (If one instance dies without notifying the server, the server won't realize it's still running.)
When each instance runs, it could listen at a port, record its IP and port number in a central file, and when you need a count you try to connect to each of those ports to confirm that instance is still running.
There are lots of ways you can do it, but the work is up to you. No help from the OS like you get when they're all on the same machine.

Error When Connecting to Quickbooks in BlindMode Using QBXML Interface

I am experiencing an issue with an application that is attempting to access Quickbooks in blind mode (i.e. Quickbooks is not running). In short, I have a simple C# application that synchronizes information between a Quickbooks company file and SQL database on a web server to allow customers to make payments toward invoices online. The UI for the application only has one button and a few other settings so, I modified the code so that it can be run as a scheduled task in the middle of the night. Unfortunately, this has been much more trouble than I anticipated.
First, I could not get it to run through the task scheduler or an elevated command prompt. Then, I came across a post that stated that there is a bug in the SDK when attempting to access Quickbooks via the QBSDK if the host is a terminal server with multiple sessions. The temporary solution was to make sure that Quickbook is running on the session that the job is running on to prevent it from trying to attach to another session. So, I made sure that Quickbooks is loaded but, NOT logged in to a company file. While this solution works if I try to run my application from an elevated command prompt it still does not work when the job is launched from the windows task scheduler. I am not logged into the server remotely now but, the error message states something about not being able to open a session because there is a modal dialog box open. I will modify the post to include the specific error message as soon as I am able to connect to my client's server. Quickbooks is open on the session that is trying to run as a scheduled task and I am able to run the application from an elevated command prompt. Can someone please offer any suggestions or feedback about how I might go about solving this problem? Thanks in advance for your help!

How can I run my application when windows session is disconnected?

I have made a simple application in C# and WHITE, which click on a button to clear the logs.
I use to connect to my test machine using Remote Desktop Connection and execute that application. It works fine when my session is connected but whenever i disconnect my session, it stops working.
Is there any way to execute that application when windows session is disconnected?
You could write a Windows Service.
You could also use the task scheduler.
You may not need the C# wrapper, you can add yourself the required entry within the scheduler.
It works fine when my session is connected but whenever i disconnect my session, it stops working.
This is by design. When you disconnect your session, it is locked. When your session is locked, UI automation won't work.
You could hack around this by never locking the session, possibly via different remote desktop tools (VNC/PcAnywhere). But this is definitely a hack.
Instead I suggest a different approach. I recommend avoiding UI automation whenever possible. I have always found UI automation to be flaky and unreliable.
In the comments on your question you said your app is simply UI automation to click a button to clear a log. The logs are generated by the DebugView application.
I suggest you log to a file instead. This feature is mentioned on the web site for DebugView:
http://technet.microsoft.com/en-us/sysinternals/bb896647
You could also look into using remote monitoring.
If size is an issue, you can also look into the "Log file wrapping" and "log-file rollover" features.
Taken from
https://www.ranorex.com/help/latest/ranorex-remote/remote-faq#c13444
Create a batch file on your remote machine and insert the code below:
for /f "skip=1 tokens=3 usebackq" %%s in (
`query user %username%`
) do (
%windir%\System32\tscon.exe %%s /dest:console
)
Save this batch file on the desktop of your remote machine and name it: 'KeepSessionOpen.bat'.
If you need to disconnect the RDP session, you can now simply run this batch file using administrator privileges and your remote machine will remain unlocked.

saving a text file in client side without asking for permission any time

I need to save a text file on the client side possibly without permission. The case is that I need to save this text file in a shared folder in this or in another machine in the lan. This text file is going to be read automatically by the fiscal printer which will print the fiscal invoice. I have a asp .net web application and the server is not on the same lan with the fiscal printer, so I have to write it on the client-side. Any idea how to do this without asking to the user every time for the security issue.
I need a cross browser solution.
I can accept a solution like, the client is asked only one time a the first printing, but not every time he wants to print a bill. Some kind of asking permission to the client for allowing this website, in order to not repeat the permission asking.
Obviously - this would be a major security breach to download files to the user's computer without them knowing. All browsers have precautions in place to prevent this from happening.
No, you can not do this. Saving a file to a computer without permission in a public folder is not allowed.
You can, however, have your Client install your application which will have the ability to read and write where you want.
A common way that Trojan viruses to this is by giving the Client some goofy program to run that displays a fireworks show or something else quite trivial. While the Client is busy wondering what he's looking at, your virus is installing quietly in the background.
Now, you are probably saying to yourself, "But I am not installing a virus." However, there is no way for a Browser to know if your application is a virus or not. That is why it is not allowed and why you can not do it.
The more applicable scenario for me is:
1- Do your work inside your web application.
2- Get the information that you need to print.
3- Send it to another computer directly (or to a hosted web service) and this computer will act as a host for these files.
4- let your server access this shared folder, and print what you want
You could use a cookie, which won't ask permission. Of course that would only work when cookies are enabled and can store limited amounts of data.

Categories