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 08:14:35
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/10/2003 15:16:01
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00841695
Message ID:
00842005
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform