Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Designing an app to support Client Server & VFP DBC back
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00153654
Message ID:
00153725
Views:
20
Ken,

I've done exactly what you're looking to do. One of my clients markets an application that was originally written for native VFP data and now supports either VFP or SQL Server. I used local views for any data that would be updated and SELECT statements for ad-hoc queries. When the user chooses a record to edit, that record is brought down in a view filtered on the primary key. This is quite fast. I wrote a function that handles sending a SQL command either to VFP or SQL Server. If the backend is VFP the command is run with macro substitution, if it's SQL Server the function sends the query to the server using SQL pass-through. I think the combination of views and pass-through is ideal because it makes updating data easy (use views) and ad-hoc querying easy (pass-through). There is some conditional code that checks which back end is in use, but it's almost completely a single code base.

I didn't use ODBC for the VFP version because VFP's ODBC driver was pretty bad at the time. While it's better now, it still seems a bit flaky. I think you'd get better results using VFP data natively.

Just my $.02

>I am a rookie to building client server applications but know how to use Foxpro tables/dbc fairly well. I have a client who wants a fairly substantial application built - and they want the backend to be VFP for now, but may wish to migrate to Client Server later. The product will be marketable -- but more valuable if it supports client/server. So I would like the application to be able to support both backends. I'm trying to figure out exactly how best to accomplish this. My fundemental question is this:
>
>What is the best approach to take in building a single application that supports BOTH VFP and Client Server backends?
>
>A friend (who may or may not know more than me on this subject) said I should access the VFP DBC exclusively through remote views/ODBC so that the data access methods will be similar for both backends. Are there advantages or disadvantages to this approach?
>
>I realize that entire books are written on this subject. I was hoping that one of you could steer me in the right direction.
>
>Thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform