Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FoxPro 2.6 Editing Queries 1

Status
Not open for further replies.

Citygirl115

Technical User
Mar 20, 2007
2
US
Hello,

I am VERY new to this program. I just started working for this company that is using this old version!

I will be working with back end tables that are pulled into database formats. I need to know if there are ways of actually writing sql code directly in FoxPro 2.6. (I also have an option of using Access 2003, but they prefer me to use the FoxPro, I think).

Also, the queries I will need to apply to different databases, so how can I write generic ones and then apply to specific dbfs?

Thanks for your help.
 
Fox 2.6 supported SQL to a degree. If you can work with a later version of Fox, you might be better off. Each version has become more ANSI compliant and has a more robust implementation of SQL. When you are working with 2.6 tables that have to be shared with a 2.6 application, you have to be careful not to change their structure with a later version.

I will be working with back end tables that are pulled into database formats.
There really was no database in Fox 2.6. There were only independent tables.

how can I write generic ones and then apply to specific dbfs?
Use the ALIAS clause.

Code:
USE MyTable ALIAS MyAlias
Now you can write your generic code refering to "MyAlias"

pamela
 
Pamela,

Would it be easier to do this work in Access instead?
 
What are you attempting to accomplish with the SQL Queries?

* Have your existing application do more?
more reporting
more functionality
etc.
* Report to a non-connected, outside entity/user?

If the former, then it would be easier and most effective to do it in one 'flavor' of Foxpro or another since the query results would indeed be used within the existing application in some manner.

If the later, then it would not matter much, but as Foxpro gurus, we'd recommend using Foxpro instead of Access.

As a general rule, whenever someone is 'inheriting' an old Foxpro application for the purpose of maintenance or enhancement, I'd recommend considering picking up a new version of Visual Foxpro and working within that on the old data tables.
NOTE: if this is done, care must be used not to modify the structure or indicies of an existing table since it would make it no longer compatible with the old Foxpro application.
Another advantage of this approach is that it would allow you the opportunity to upgrade the entire application if desired.

A reminder note to what Pamela said above...
These old versions of Foxpro do not have databases per se - despite a number of users sometimes erroneously using that phrase.
Instead they have free data tables (DBF files) which are not contained within a "database" container.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top