for ix = 1 to fcount() if empty(eval(field(ix))) and type(field(ix)) $ "MDT" REPLACE (field(ix)) WITH NULL endif endfor>Hi again Josh,
* Local database with remote view emp_view_remote - testdata!employee here >* All fields updatable except Photo - general (I couldn't include it:() > >llOffline = createoffline("emp_view_remote","d:\temp\mydata") && Create offline >if !llOffline > messagebox("Couldn't created offline") >endif >set multilocks on >set exclusive off >use ("emp_view_remote") > >3 && Go to a random record >scatter memvar memo >m.emp_id = str(recco()+1,3) >insert into ("emp_view_remote") from memvar && Newrec for lazy tester :) >=newrec() && Create a new empty rec >=newrec() > >browse && Make edits and adds >use && Close it > > >* Reconnect to the host and open the view. >USE emp_view_remote ONLINE EXCLUSIVE && Get online > >if !tableupdate(1,.f.,"emp_view_remote") > lnErrElems = aerror(aErrors) > for ix = 1 to 6 > ? aErrors[ix] > endfor > wait "Errors listed for rec : "+str(recno("emp_view_remote"),5) >endif >use >dropoffline("emp_view_remote") > > >function newrec >scatter memvar memo blank && New empty record w/o nulls > >* Normally this check is a matter just before tableupdate() >* fill in for test >for ix = 1 to fcount() > if type(field(ix)) = "M" > store " " to ("m."+field(ix)) ><B>* Prevent null + invalid string length for ODBC driver >* Whenever I left memo in a new rec empty I get "Invalid string length" > endif > if type(field(ix)) $ "D" > store {1/1/100} to ("m."+field(ix)) && Prevent datatype mismatch for date > endif > if type(field(ix)) $ "T" > store dtot({1/1/100}) to ("m."+field(ix)) && Prevent datatype mismatch for datetime</B> > endif >endfor >m.emp_id = str(recco()+1,3) > >insert into ("emp_view_remote") from memvarI wonder should I really do this type of check. TIA.