Solved

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

Posted on 2001-06-14
8
542 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
8 Comments
 
LVL 5

Expert Comment

by:rkot2000
Comment Utility
>>> 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
Comment Utility
do you have enough permission over those files?
0
 

Expert Comment

by:gargjapan
Comment Utility
Yes, We have permission to those files.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 200 total points
Comment Utility
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:Moondancer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now