Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

File previlages for the current logged user

Posted on 2004-09-14
2
Medium Priority
?
207 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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