Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP vs. SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00523306
Message ID:
00524792
Views:
11
>>>>You may just have to bite the bullet and do both. Think about this one, one of the companies I work for bit the bullet and we "talk" to either VFP, SQL-Server or Oracle and use only one code set. We wrote a class called a query agent which allows us to create a cursor object to which we populate properties such as from, fields, where, etc. When a user logs in, they have an option to select which database (or databases) they want to connect to. The query agent receives the cursor object from the caller and creates a SQL string to get the data based on what database the user is connected to. This class is powerful enough to where we can actually connect to a database of each type and display 3 end-user queries, one from each database. But the real beauty of it is that we do this with one VFP code set. We even had Oracle consultants tell us that what we wanted to do couldn't be done.....guess we just couldn't take that for an answer.
>>>>
>>>
>>>Steve, tell me more about the query agent, please.
>>>
>>>Thanks, Alex
>>
>>Hi Alex,
>>
>>Basically it is a class definition that holds type of database, connection information, etc. When a cursor object with it's properties defined is passed to the .Execute method of the Query Agent (QA), the QA looks at the properties and builds, with the correct syntax according to the database connected to, a SQL statement to retrieve the data. Standard VFP code instantiates the cursor object and populates it's properties. The QA translation mechanism even deciphers things we can do in VFP-SQL, like an IIF() function, into the proper syntax for SQL-Server or Oracle. This allows us to use only the one VFP codeset, and VFP knowledge, to write the application. Oracle folks said we'd have to use a multitute of stored procedures for each database which meant code to maintain in all three databases which is why we could not accept that approach.
>>
>>Steve
>
>Very interesting. Is there any posibility of getting a copy of this class ? Thank you.
>
>Alex

Alex,

I'd be shot dead on sight were it released. The time and effort that went into it was extensive and is one of the best components of the application even though it means nothing to an end user.

I will add one thing to my above statements....when the QA executes a query, we have properties defined which designate to keep all temporary cursors on the server and only returns the data needed for display when requested to actually return it to the client.

Steve
Previous
Reply
Map
View

Click here to load this message in the networking platform