Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field valid - works only first time
Message
De
16/01/2006 09:24:12
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Field valid - works only first time
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Oracle
Divers
Thread ID:
01087131
Message ID:
01087131
Vues:
58
Hi,
This code is in field validate method of txtTip control with Tip_o.Tip_obj controlsource.
The problem is that only when first time invoked it detects properly if any record with
such value exists. After that duplicate values are not signalized till commit in database.
(ORA - ...... ). I also modified code and move it in next control Gotfocus event but with
the same result. Any help appreciated.
*
LOCAL s, v, _tip
*
_tip = ''
s = 0
*
_tip  = thisform.txtTip.value
*
IF thisform.IsNew('Tip_o')
   IF !empty(thisform.txtTip.value)
      *
      v=SQLEXEC(thisform.oCDE.cdNesto.nConnID,;
      "Begin SELECT COUNT(*) into ?@s from Tip_o Where Tip_o.TIP_OBJ=?@_tip;End;")
      *
      IF s > 0
         thisform.oCDE.DisplayMessage('Tip  exists  ! - '+STR(s,2)+' '+_tip )
         RETURN .F.
      ENDIF
      *
   ENDIF
*
ENDIF
Regards, Gojko

PS
(BTW: How do you earn code rows to be on light blue background and intended ?)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform