PRB: Null RuleExpression, RuleText, and Default View PropertiesLast reviewed: January 16, 1998Article ID: Q179298 |
The information in this article applies to:
SYMPTOMSThe following error message is returned when you attempt to use a view:
Error reading a property from the database. The property is ignored. CAUSESetting the RuleExpression, RuleText, and/or the Default property of a view field to an illegal value causes this behavior. Examples of illegal values include the null string ("") or setting a RuleExpression property to a text string, such as "This field cannot be empty."
RESOLUTIONIn order to prevent the error message from appearing it is necessary to re- create the view with valid field properties. The following code re-creates a view from the view definition stored in the database container:
PARAMETER viewname
thisversion=VERSION()
IF LEFT(ALLTRIM(thisversion),6)="Visual"
thisversion=VAL(SUBSTR(thisversion,15,2))
ELSE
thisversion=0
ENDIF
SET EXCLUSIVE ON
SET MULTILOCKS ON
DECLARE viewprops[1,5]
OPEN DATABASE home()+"\SAMPLES\DATA\TESTDATA" EXCL
sql_statement=DBGETPROP(viewname,"VIEW","SQL")
llsendupdates=DBGETPROP(viewname,'View','SendUpdates')
lnupdatetype=DBGETPROP(viewname,'View','UpdateType')
lnwheretype=DBGETPROP(viewname,'View','WhereType')
lnbatchupdatecount=DBGETPROP(viewname,'View','BatchUpdateCount')
lnusememosize=DBGETPROP(viewname,'View','UseMemoSize')
lnfetchsize=DBGETPROP(viewname,'View','FetchSize')
llfetchmemo=DBGETPROP(viewname,'View','FetchMemo')
lnmaxrecords=DBGETPROP(viewname,'View','MaxRecords')
lctables=DBGETPROP(viewname,'View','Tables')
lccomment=DBGETPROP(viewname,'View','Comment')
IF thisversion>=5
llprepared=DBGETPROP(viewname,'View','Prepared')
llcomparememo=DBGETPROP(viewname,'View','CompareMemo')
llfetchasneeded=DBGETPROP(viewname,'View','FetchAsNeeded')
ENDIF
USE &viewname
=AFIELDS(viewflds,viewname)
USE
FOR i=1 TO ALEN(viewflds,1)
DIMENSION viewprops[i,5]
fld_name=viewflds[i,1]
viewfield=ALLTRIM(viewname)+"."+ALLTRIM(fld_name)
viewprops[i,1]=DBGETPROP(viewfield,'Field','KeyField')
viewprops[i,2]=DBGETPROP(viewfield,'Field','Updatable')
viewprops[i,3]=DBGETPROP(viewfield,'Field','UpdateName')
viewprops[i,4]=DBGETPROP(viewfield,'Field','DataType')
viewprops[i,5]=DBGETPROP(viewfield,'Field','Caption')
NEXT
DELETE VIEW &viewname
CREATE SQL VIEW &viewname AS &sql_statement
=DBSETPROP(viewname,'View','SendUpdates',llsendupdates)
=DBSETPROP(viewname,'View','UpdateType',lnupdatetype)
=DBSETPROP(viewname,'View','WhereType',lnwheretype)
=DBSETPROP(viewname,'View','BatchUpdateCount',lnbatchupdatecount)
=DBSETPROP(viewname,'View','UseMemoSize',lnusememosize)
=DBSETPROP(viewname,'View','FetchSize',lnfetchsize)
=DBSETPROP(viewname,'View','FetchMemo',llfetchmemo)
=DBSETPROP(viewname,'View','MaxRecords',lnmaxrecords)
=DBSETPROP(viewname,'View','Tables',lctables)
=DBSETPROP(viewname,'View','Comment',lccomment)
IF thisversion>=5
=DBSETPROP(viewname,'View','Prepared',llprepared)
=DBSETPROP(viewname,'View','CompareMemo',llcomparememo)
=DBSETPROP(viewname,'View','FetchAsNeeded',llfetchasneeded)
ENDIF
FOR i=1 TO ALEN(viewflds,1)
fld_name=viewflds[i,1]
viewfield=ALLTRIM(viewname)+"."+ALLTRIM(fld_name)
=DBSETPROP(viewfield,'Field','KeyField',viewprops[i,1])
=DBSETPROP(viewfield,'Field','Updatable',viewprops[i,2])
=DBSETPROP(viewfield,'Field','UpdateName',viewprops[i,3])
=DBSETPROP(viewfield,'Field','DataType',viewprops[i,4])
=DBSETPROP(viewfield,'Field','Caption',viewprops[i,5])
NEXT
RETURN
STATUSMicrosoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONWhen a view is created, the default value for the RuleExpression, RuleText, and Default field properties is a null string.
Steps to Reproduce Behavior
Keywords : FxprgSql FxprgTable VFoxMac vfoxwin Version : MACINTOSH:3.0b; WINDOWS:3.0,3.0b,5.0,5.0a Platform : MACINTOSH WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |