Versions des environnements
>>>>>Thank you. Hopefully your preferred code works with both VFP and SQL Server. This will make it easier to maintain the code.
>>>>>
>>>>No, you still need to maintain 2 different versions.
>>>
>>>I see. Thank you for clarifying.
>>
>>You could use Cast(Field as Integer) = 1 in both SQL and VFP.
>
>Thank you. I didn't realize this could be done. But I am thinking if CASTing will slow down the SQL Select. Because I already decided that I will have two syntax versions (not very difficult), one for VFP and one for SQL. Your approach, of course, has advantage of just one code.
YOu could leverage OOP: define a property on a fitting structure (CA if used)
and set it depending on the backend used: if vfp, .t., if MsSQL, Ora,.. 1
and in code always compare to that property. Depends a lot on the objects you use ;-)
Compiler constants could be used if different versions depending on backend are deployed.
regards
thomas
Précédent
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