Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select expression for both VFP and SQL DB
Message
From
29/03/2019 09:48:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01667660
Message ID:
01667690
Views:
45
>Hi Cetin,
>Thank you very much for your input and for sharing your code.
>I am using a Cursor Adapter in a data-driven mode. All fields that have to be in the SQL Select are in a meta .DBF table. So, for calculated field (like the one I have asked in this thread) I use the "Cast(0 as bit)" in the field_expression column of the DBF. My solution is either not to use the calculated column, when the back end is VFP. Or, add another field to the meta DBF (e.g. VFP_EXPR) and enter the "Cast(0 as Logical" in this field.
>Then, when the CA is initialized, both - VFP and SQL - will be covered.
>But I have not yet decided what to do for VFP.

I am also using CursorAdapter + direct commands like SQLQueryInto (does a select into a cursor with parameters), SQLNonQuery (runs non query command with parameters like update, delete), SQLInsert (as name suggests) and SQLExecuteScalar.
Saying meta, do you mean CA classes and Cursor structures? In my case, I found it more appropriate to have 2 sets of CA classes, CA_VFP.prg and CA_SQL keep them. I instantiate the CA from one of them based on current 'app mode'.
Ç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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform