Menu

#4 updateRecord fails with boolean field

open
nobody
None
5
2008-11-03
2008-11-03
Kevin Ilsen
No

I was having a problem updating a record that contained boolean fields -- if the record I attempted to edit contained a boolean value, it was prefilled in the form as "True" or "False" but then the update failed with an error message that was generated by the field validation routines. I studied the code and noticed that it's treating booleans (field type 11) just like dates (field type 7), and therefore it's testing the field value using isDate(), and later it's delimiting the value with "#" characters to set the value in the database. I modified the code to store booleans the same way that it stores numerics (i.e., with NO delimiters), and I simply eliminated the field value test. But I think it would be better to do a more rigorous test of the boolean value. There's no "isBoolean" function in VBScript, but it should be possible to test for all possible "legal" boolean value ("False" and "True" in any case, etc.)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.