Solved

File previlages for the current logged user

Posted on 2004-09-14
2
203 Views
Last Modified: 2013-11-20
I have created a database file in Administrator mode  under windows XP operating system  using vc++ application. When I login as a Guest and try to open the same file using my VC++ application it fails.
Please suggest me how do I know the current user permission for a file using MFC coding .
0
Comment
Question by:shrinivasbk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 100 total points
ID: 12052710
Do you want to read the exact file permissions or do you just want to know if privileges unable the current user to open that file?
For latter you can supply a CFileException as last parameter in CFile::Open. In case of a failure to open this exception var will be filled and you can check its m_cause member. If it equals CFileException::accessDenied you don't have enough priviliges.

If you want the full access priviliges of that file you need to run a program as administrator and check/read its permissions. This only makes little sense in the context you asked so I don't go into detail here.
0
 
LVL 13

Expert Comment

by:SteH
ID: 12062645
Hi shrinivasbk,

it would be nice to get a second chance before receiving a grade of C. You question was not very detailed so a detailed answer could not be expected in the first go. Experts are willing to give more detailed anwers if needed but you need to allow tem to.

You might want to read the help on grading at
http://www.experts-exchange.com/help.jsp#hi73
<snip>
# C: Because Experts' reliability are often judged by their grading records, many Experts would like the opportunity to clarify if you have questions about their solutions. If you have given the Expert(s) ample time to respond to your clarification posts and you have responded to each of their posts providing requested information; or if the answers, after clarification, lack finality or do not completely address the issue presented, then a "C" grade is an option. You also have the option here of just asking Community Support to delete the question.
<snip>

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expand to include initial dialog with two choices. 9 86
WinWaitActive parameters 12 31
centeredAverage challenge 8 185
sum13 challenge 24 134
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seveā€¦
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question