Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null date to empty(and back again)
Message
De
25/08/2009 12:32:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
25/08/2009 12:10:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01420493
Message ID:
01420499
Vues:
46
>I'm using local views without nulls, and blank dates are valid within the application. I'm considering going to remote views, but lack of an empty date, nulls and/or the automatic date entry are warping my little brain. Is there a fast and easy way to convert to blank VFP dates when using the view, and saving to the backend as null or whatever?
>
>Chris.

Using cursoradapter class you can define conversionfunc. ie:
Define Class Ca_MyTable As MyCaBase OF MyCAClasslib.prg
*...
	ConversionFunc = "MyDate E2N, MyChar TRIM"
*...
ENDDEFINE
and e2n.prg:
Lparameters tuValue
If Empty(m.tuValue) OR (Vartype(m.tuValue) = 'C' And Trim(m.tuValue) == '{}')
	Return .Null.
Else
	Return m.tuValue
Endif
I suggest totally forgetting about "empty" date/times and use nulls instead.
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform