Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COM Object (ADSI) Error Trapping?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00489229
Message ID:
00489246
Vues:
13
What doesn't work about ON ERROR? An alternative is to program this functionality into a class and have an Error event. You have to trap for OLE errors (usually 1426 - 1428).

HTH.

>I am having a little trouble with error trapping/handling with ADSI in my .prg.
>
>0. I created some dummy local user accounts.
>1. I created 3 local groups on my NT4 box called lvl1, lvl2, lvl3 and put a user in each.
>2. I created a .dbf called AccessMap which has a list of local groups that should be queried for membership.
>
>I am now scanning through AccessMap, looking for a match between my user name and the local group I belong to. I have 4 rows in the table, but only 3 local groups, so when I get to "lvl4" in my table, VFP says:
> OLE error code 0x800708ac: Unknown COM status code.
>What's the best way to trap this kind of OLE error? I originally did "On Error *" but that's just sloppy and doesn't work right anyway. Help?
>
>
>cAccount = "Steve"
>Select AccessMap
>Scan
>oGroup = GetObject("WinNT://" + "SCraft" + "/" +AllTrim(cGroupName) )
>For Each oAcct in oGroup.Members
>If Upper(oAcct.Name) = Upper(cAccount)
>? oAcct.Name + " = " + cGroupName
>EndIf
>Next
>EndScan
>
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform