Getting the list of shares connected to a machine - mfc-networking

Consider that i have connected to multiple shares of a remote machine( \\machineA\share1, \\machineA\share2....) along with shares on other remote machines.
Now my question is how to find only those shares which are connected to a particular machine. For eg, only those shares which are connected to machineA.
I already came across WNetOpenEnum and WNetEnumResource. But these are highly inefficient that they will return all shares which are connected to my machine and then i will have to search through the results for the shares connected to machineA:(
I need to know if there is some other function, using which i can find the share.
I am working on VC++ 6.0.
edit: Hey guys having another trouble. Whenever i try to connect to a share on the machine i get the following error:
"The referenced account is currently locked out and may not be logged on to"
Has anyone encountered this problem and how was it solved

To resolve your lockout problem, log onto a the target server (Or, if it's on a domain, log onto any domain controller on that domain), go to Control Panel > Administrative Tools > Active Directory Users & Computers, navigate to the User you're logging in as, and unlock it.
If the system is not on a domain, simply log onto it and unlock the account via the "Local users & Groups" tool in compmgmt.msc.

Iterating through all shares and only picking the ones you want, to me, looks as efficient as it gets. Is there some circumstance why you can't do it? (except laziness ;))

foreach (string systemName in systemNames)
System.IO.Directory.GetDirectories("\\"+systemName+"\");

Related

One user cannot edit data in Access

I have an inventory tracking Access database where a user should be able to open the "Edit Inventory" table, and edit the on-hand values of items in our department. However, the computer that uses this the most is now displaying a message of "This dataset is not updatable." I tried to edit the data from my computer as well as another user, both of which worked just fine. I checked to make sure the mapping of this computer was correct, and it is.
I am by far no expert on Access. This database pre-dates me and the creator has since retired.
That being said, I am wondering if it has to do with how this computer is logged into. Because it is a shared computer, it has very limited access to tools--it is basically only used for this inventory file. Because of the shared status, every time I open access, it asks the user to log into Microsoft, which we then skip because there is no shared Microsoft account. We log into this computer using "computername[departmentname]." I checked the client settings to ensure everything was shared and no locking was occurring. This just began occurring 2 days ago, so it is a very new issue that came up out of the blue.
Any advice or ideas is appreciated! Thank you in advance!

Network access was interrupted

The Access database just needs to be open and it will usually crash within the next 20-40mins, resulting in the following error message:
Your network access was interrupted. To continue, close the database, and then open it again.
More details:
The database is split, with the back end and front end on a server. The computers are then connected to the server via LAN (ethernet).
Although there are multiple computers connected to the server, the database only has one user at a time.
The database has been fine for almost a year, until this week where this error has started occurring.
We never have connectivity issues with the server.
I have seen several answers saying it is:
the databases fault, as it is starting to corrupt
the servers fault, as it broken, dropping my connection briefly
microsofts fault, they should patch it
I am hoping this is a problem with the database itself, as I am not responsible for the server.
Does anyone have a definitive solution?
I have recently experienced the same problem, and it all started when I moved my DB in an extrernal disk. The same db was working just fine in the local disk, or in the previous external disk. So, i am guessing is just a bug that has to do with the disk letter changing or something like this.
The problem sounds like an unstable LAN connection OR changes the LAN location (e.g. new hardware or changs to admin settings) causing increased latency.
If you have forms in the FE bound to BE tables the latency can cause the connection to be severed resulting in the error you see.
I'm not a network admin but the main culprits I've seen are:
Users connecting to the network using a VPN using an unstable connection (cell phones, crappy wifi, or just bad ISP service).
Network admins capping persistent connections to a share causing disconnects.
Unstable network hardware or bad hardware configuration.
"Switching" between wired and wireless LAN connections.
I don't think the issue is the database other than having bound forms to a BE database which is more of a fundemental design problem than anything else.
Good luck!
I use Access 2010. I had the same issue but solved it in the following ways.
On the external data ribbon, go to the Import & link group and click on Linked Table Manager.
Click on select all.
Click on Ok to refresh the links.
In cases where the path of the BackEnd database file has been changed, browse to the new location and select the new path. This will also refresh the links. This will solve the problem. It did for me.
You wrote, "The database has been fine for almost a year, until this week where this error has started occurring."
Clearly something has recently changed for this to be happening and without narrowing the field of possibilities it's anyone's guess. However, in my experience Jet DB crashes when two or more users are accessing and editing the same record(s) at the same time. So, if you've recently added new users this is a possibility.
Note: Jet is a file-server DB not a client server, which means the app was probably designed for a specific number of front-end users. Without knowing more I would start there.
I resolved my issue on this when I figured out that I had a offline directory setup and the sync was having an issue I turned off the sync and tested it and the error went away.

How do I lock down an Access database on macro-disabled systems?

question for you.
So I have this Access 2007 database that I'm trying to lock down so that it can be deployed. The intent is for multiple users to run the front-end application simultaneously, connecting to the back-end tables over the network. However, I obviously don't want to give them access to the forms, settings, tables, etc.
I already tried using the ChangeProperty function for
AllowFullMenus
AllowSpecialKeys
AllowBypassKey
AllowShortcutMenus
AllowBuiltInToolbars
AllowToolbarChanges
AllowBreakIntoCode
But whenever anyone without macro's explicitly enabled opens the database, everything opens as if none of these settings are set. How can I get around this? I only use like 3 macros in the program, and none of them are related to the opening of the database or locking down the database.
Suggestions?
Thanks.
You can try distributing your front-end as a locked ACCDE file, this is the equivalent of the old MDE files from Access 2000. Details are available here: http://www.databasedev.co.uk/convert_to_accde_format.html

StreamWriter Only Works on Some Workstations

I have a page on an intraweb (that I didn't create) which allows a user to specify a .txt file and then it writes the results of a SQL stored procedure to the file using StreamWriter.
It apparently stopped working for some of my workstations several months ago, so I can't trace it to any specific changes (However, I know the code itself didn't change).
If I access & use the page on the server (where the wwwroot and applicable database are located), it successfully writes the .txt, whether I specified a local file or on a workstation on the network. Users on some workstations,though, are no longer able to write to a file.
(It is also not just writing a blank file. The "Date Modified" remains unchanged.)
The problem seems to be machine-related rather than user-related, as I can login as the same user on different workstations with different results.
I still think it may have something to do with permissions, so I created a .txt on a problem workstation with every possible account having full permissions, but no luck. Permissions on the database, stored procedure, and folder destination seem correct.
Any suggestions welcome, Thanks.
You mean to tell us that the page completes with success, your calls to StreamWriter all succeed, and yet in the end there is no file? I find that really hard to digest. A much more likely hypothesis is that the page fails and exception is thrown. Such an exception would be logged normally in the system event log.
From the description of your symptoms the issue could be a constrained delegation scenario: the page is impersonating the IE user and it cannot flow the credentials to whe accessing the network resource.
It turned out to be the IE security setting "Include local directory when uploading files to a server". This setting is disabled by default.
The working PCs had the setting enabled for some reason. Adding the site as a "Trusted Site" also enables the setting, achieving the same result.

using IsolatedStorageFile with Silverlight 4

I am looking at writing a silverlight app that I plan to use OOB setting to enable use on both PC and mac.
I have been doing a little investagation on the isolationstoragefile and what I understand is it will work for both pc and mac without a problem.....Is that correct?
The application I am building is going to be a business application that will submit details back to the main database if there is an available connection. If not then I want to store the information locally until there is an available connection.
My question is lets say I have 3 user accounts using the same machine. Can I have the isolationfile stored in the same place? or must it be under the user profile?
I don't want to have orphaned records which I could see happening if the data is stored on each user's profile.
Any advise would be great!
I understand is it will work for both pc and mac without a problem.
That is correct. You don't need to worry about the mechanics of how it is persisted to disk.
I have 3 user accounts using the same machine. Can I have the isolationfile stored in the same place? or must it be under the user profile?
IS is located under the user profile. In a full trust (elevated) OOB app you may be able to store files elsewhere on the file system by using the FileSystemObject or by using some COM interop, but there is no guarantee that you can get to that file again (NOTE: i haven't played with saving files external to IS, so may be wrong/misinformed on this). If you can whack files out to anywhere on the file system you should be very careful doing it - what if you are running on a Mac?
I don't want to have orphaned records which I could see happening if the data is stored on each user's profile.
If you mean data may be stored locally because of no connection, then that user logs off and never logs back in again to that machine so their data never syncs to the server, then yes that is a possibility. Having a service monitoring for saved data files would be ideal, but you can't do that under SL. To completely eliminate that issue may take a change in your product, like writing it as a WPF client instead of SL.

Resources