What about editing the view field to use an evl(fieldname,null) when
returning that field?

Regards
Michael Hawksworth


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Vince Teachout
Sent: 15 May 2007 22:21
To: [EMAIL PROTECTED]
Subject: Re: Help! View is converting empty date to 1899!

Ted Roche wrote:

> What are you thinking about for a work-around?

Replacing the empty dates with NULLS, which works fine:

OPEN DATABASE tadb
SET DATABASE TO TADB
=ADBOBJECTS(aFiles, "TABLE")
FOR ni = 1 TO ALEN(afiles)
        cFile = afiles[ni]
        IF FILE(cfile+".dbf")
                USE (cfile) SHARED
                FOR nJ = 1 TO FCOUNT()
                        IF TYPE(FIELD(nj)) = 'D'
                          cField = FIELD(nj)
                        cCommand = 'replace ALL ' + cField + ' WITH
.NULL. FOR EMPTY(' 
+ cfield + ')'
                                TRY
                                &cCommand
                                CATCH
                                endtry
                        ELSE
                                LOOP    
                        endif
                ENDFOR
                USE IN (cfile)
        ENDIF
  ENDFOR        


> There's a reason why you are using a remote view to access local Fox
> data, but I can't ask. It's too bad, because the answer to that
> question could open up different avenues of discussion 

Okokokok - it's because it's a legacy system already deployed in about 
40 different locations.  Has never been a problem until now because 
people always started with empty data sets, and as they added them, 
entered dates, OR left them empty, which saved a NULL.  This is the 
first time we're converting existing data, and I converted empty to empty.


> If you think you're emulating
> client-server for other database support, well, you've got an
> educational experience coming. If you have some clever idea about
> remoting DBF tables via ODBC, that doesn't work the way you suspect it
> does. If you're doing something completely different, well, that might
> be interesting. 

Sort of a bastardization of 1 and 2:  That was their solution for 
supporting multiple backends.  Make everything remote views, have a 
switch and DEFINES in an include file for the remarkably few times the 
SELECT syntax is different, and VOILA!  The system is so simple, that it 
actually works remarkably well.  I inherited the system from the person 
inheriting the system from the programmer who created it.


-- 
Vince Teachout
Caracal Software
www.caracal.net
518-733-9411


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to