?
Solved

URJENT :TOUGH ONE:GetAttr  and SETATTR ERROR , Help me out

Posted on 2001-06-14
8
Medium Priority
?
563 Views
Last Modified: 2012-06-27
Hello experts,
I hope that you will be able to resolve my problem.

1) why these two behavior occurs and I want to how to workaround for them.?

2)Is  there  any other similar VB function which relies on Windows and can causes similar problem.?


============================================================================
===
[Behavior 1]
============================================================================
===
1) Where the behavior occurs:
In the process where GetAttr obtains the file attribution and then SetAttr
changes the attribution.
2) Problem Behvior
Under the Windows 2000 environment, if GetAttr obtains the attribution which
SetAttr does not support (*1), executing SetAttr results in Runtime Error 5.

*1: 8192(0x00002000) FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
3) Workaround
Changed to use GetFileAttributes, SetFileAttributes.

============================================================================
===
[Behavior 2]
============================================================================
===
1) Where the behavior occurs:
In the process where GetAttr obtains the file attribution from a root
folder.

2) Problem Behvior
Under the Windows 2000 environment, (with GetAttr) an attempt to obtain the
file attribution of hiberfil.sys which exists when the (Power Suspended Status Support]
option is set to ON results in Runtime Error 5.

3) Workaround

Since GetFileAttributes causes the same error, I use the error trap (OnError
Goto) to workaround this behavior.

Although the behavior #1 and #2 have already been workarounded, and these
two behaviors do occur on Windows 2000, I am going to do some research
about my application to check if there is any other potential problem
related to a VB function which relies on Windows like the above listed two
behviors.

Regarding with any VB function problem which relies on the Windows version,
could you guys please tell us what causes the problem, and how I should work it?

Thanks in advance


0
Comment
Question by:vbhelper
[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
8 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6191502
>>> any other potential problem
related to a VB function which relies on Windows like the above listed twobehviors.

I had similar problems with compressed files under NT or 2000.

>>>could you guys please tell us what causes the problem, and how I should work it?

vb supports only the following attributes :

vbNormal 0 Normal (default).
vbReadOnly 1 Read-only.
vbHidden 2 Hidden.
vbSystem 4 System file.
vbArchive 32 File has changed since last backup.


As work around you can do the following :
1.     Get attribute.
2.     I=getattr(??)
3.     Check the attribute using following logic:
4.     if I and vbSystem then

0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6192352
do you have enough permission over those files?
0
 

Expert Comment

by:gargjapan
ID: 6193450
Yes, We have permission to those files.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 800 total points
ID: 6195267
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6418367
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.
 
PLEASE DO NOT AWARD THE POINTS TO ME.
 
____________________________________________
 
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back in about one week to finalize this question.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
0
 
LVL 3

Expert Comment

by:modder
ID: 6418498
vbhelper and gargjapan are duplicate accounts. What is more, they both have a tendency to abandon their questions as soon as they have their answer.

Their accounts have been closed. Which leaves these open questions as so many loose ends.

Of the participants I would like to ask, please advise. Did anyone provide enough info to deserve the points? Or should this question be deleted?

Thank you

modder
Community Support
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6418792
modder, i don't know what to say.
I would like to let it to your better knowledge :)
Cheers
By the way, all of you are doing great work here.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6419658
I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

765 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