Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RI Delete Restrict not Working?
Message
De
31/01/2009 18:43:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
RI Delete Restrict not Working?
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01378619
Message ID:
01378619
Vues:
53
I have my RI set to restrict delete rules for a child table. My maintenance form lets me delete the parent record with child records linked to it, until I try to close my form. Then I get a trigger failed error. I must be accidently overriding some default behavior? Do I need to set other properties in my business object to make with work correctly?
I am using MM framework, VFP SP2 on Vista.
Here is the RI code section:
SELECT (lcParentWkArea)
pcParentDBF=dbf()
pnParentRec=recno()
STORE CID TO lcParentID,pcParentID
pcParentExpr="CID"
lcChildWkArea=riopen("users","cgroupid")
IF lcChildWkArea<=0
  IF _triggerlevel=1
    DO riend WITH .F.
  ENDIF at the end of the highest trigger level
  RETURN .F.
ENDIF not able to open the child work area
pcChildDBF=dbf(lcChildWkArea)
llRetVal=!SEEK(lcParentID,lcChildWkArea)
SELECT (lcChildWkArea)
pnChildRec=recno()
pcChildID=CGROUPID
pcChildExpr="CGROUPID"
IF !llRetVal
  pnError = rierror(-1,"Delete restrict rule violated.","","")
ENDIF
=rireuse("users",lcChildWkArea)
IF NOT llRetVal
  IF _triggerlevel=1
    DO riend WITH llRetVal
  ENDIF at the end of the highest trigger level
  SELECT (lcStartArea)
  RETURN llRetVal
ENDIF
IF _triggerlevel=1
  do riend with llRetVal
ENDIF at the end of the highest trigger level
SELECT (lcStartArea)
RETURN llRetVal
** "End of Referential integrity Delete trigger for" user_group
Amanda Morton
System Analyst
Harrisburg Project
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform