Information générale
Titre:
How to configure cursoradapter to convert null date to empty
In SQL Server there is no such thing as empty date. This fact is a base of one of the main problems while upsizing existing VFP application.
In VFP9 sending empty date as null date to SQL Server is quite easy using .ConversionFunc property of an cursoradapter and a user defined function say ConvertEmptyDateTonull().
In opposite direction (sending SQLServer null date as empty date to VFP cursor) it is not as easy. I should rather say it is still easy but it is not so elegant.
My way is using in aftercursorrefresh and aftercursorfill method such steps:
- set .sendupdates to .f.
- update null dates with empty dates
- TABLEUPDATE(,,)
- set .sendupdates to .T.
The way is quite easy - but I did not like it mainly because updating takes time especially when there is many null/empty dates and many date fields in a table.
I still wonder if is there a smarter/quicker/better way - it should be.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement