Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HT update remote sql table smalldatetime datatype?
Message
De
22/12/2003 19:12:34
 
 
À
22/12/2003 18:23:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00861453
Message ID:
00861464
Vues:
19
>How do I update a remote sql table smalldatetime datatype through a VFP remote view? Right now it updates the columns with 1/1/1900.

This is in regards to empty dates, right? otherwise, as long as the view column's datatype is set to "T", it should be working ok...

There is no such thing as an 'empty' date in SQL Server. MSSQL stores the datetime values as a 8-byte format representing a number, so an 'empty' value is 0, which translates to 1/1/1900 when it is returned to the caller.

There's a couple of ways of handling 'empty' dates in SQL Server:
1) Allow nulls in the SQL Server column and handle the nulls in VFP and sql statements sent to the server. This is easy to handle in VFP, but null handling in SQL Server can get pretty complex, depending on the query.

2) Allow 1/1/1900 to be the default value [and 12/31/9999 to be the default values for top end dates of ranges] and handle the values in VFP. The SQL Server code gets easier, but the VFP side gets trickier, esp in regards to binding controls. [that alone makes me opt for option 1 <s>]
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform