Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field valid - works only first time
Message
 
 
To
16/01/2006 09:24:12
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Oracle
Miscellaneous
Thread ID:
01087131
Message ID:
01087467
Views:
12
How Oracle table Tip_o could be a controlsource for the textbox?
You can use Debugger to step through the code and see why it fails.

>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 ?)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform