Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is it possible to prevent field validation from running?
Message
From
24/10/2003 09:31:20
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
24/10/2003 08:14:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00841695
Message ID:
00842065
Views:
29
Thanks for the code snippet Cetin. I decided to take Gregory's idea since I can't be certain that the table could be used exclusively.

Mike


>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
Previous
Reply
Map
View

Click here to load this message in the networking platform