Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is it possible to prevent field validation from running?
Message
De
24/10/2003 08:14:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/10/2003 15:16:01
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00841695
Message ID:
00842005
Vues:
19
I was in a hurry when I replied, sorry. As Larry said alter table works but needs exclusive access. Greg's suggestion of modifying the stored proc itself sounds to be a better approach.

Alter sample :
lcTable = 'myTable'
USE (lcTable) exclusive
Open Database (CursorGetProp("Database",lcTable))
lnFields = AFields(arrFlds)
For ix=1 to lnFields
 If !Empty(arrFlds[ix,7])
    lcColumn = arrFlds[ix,1]
    Alter Table (lcTable) alter column &lcColumn drop check
 endif
endfor
*replacements
For ix=1 to lnFields
  If !Empty(arrFlds[ix,7])
    lcColumn = arrFlds[ix,1]
    lcCheck = arrFlds[ix,7]
    Alter Table (lcTable) alter column &lcColumn set check &lcCheck
  endif
endfor
Cetin

>Hi Cetin,
>
>Thanks for your input. I did a bit of searching in the VFP help file for DBSETPROP and field rules for tables are read-only so it appears that I can't "set validations off" :(
>
>Regards,
>
>Mike
>
>
>>Off the top of my head :
>>-You could set validations off (dbsetprop)
>>Do your work
>>-Restore validations
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform