Solved

Foxpro limitations

Posted on 2006-11-12
10
1,645 Views
Last Modified: 2007-11-27
Hi,

A client has asked me to take a look at a foxpro backend and access frontend system. The issue the client is having is that no one has any foxpro experience as the developer has long since gone.  I've yet to see the application but it would be good to know if there are any solid reasons to move away from this architecture i.e. are there any know limitations with foxpro.  (I will be finding out the version number tomorrow but I suspect is an old version of foxpro).

I may be advising the clinet to move to an access backend and frontend design so the more reasons I can give the better.

Thanks
0
Comment
Question by:geraintcollins
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 18

Accepted Solution

by:
Data-Man earned 20 total points
Comment Utility
If the FoxPro tables are linked to the Access frontend, it will have to be via ODBC...ODBC is slower than having the data stored in Access tables.

Mike
0
 
LVL 54

Assisted Solution

by:nico5038
nico5038 earned 20 total points
Comment Utility
Not switching to "only Access" will require the client to maintain not only a copy of Access, but also of Foxpro when tables need to be changed....
He'll never notice the difference, but he'll stay dependent on (some) Foxpro knowledge.

Nic;o)
0
 
LVL 18

Expert Comment

by:Data-Man
Comment Utility
Nico...good to have you back..mike
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Thanks Mike, I'm here to stay :-)

Nic;o)
0
 

Author Comment

by:geraintcollins
Comment Utility
ok so I've met with the client and its foxpro 2.6 - (released in 1989!).  He's happy to migrate to Access. Any ideas how to import the data from fox pro 2.6?  Not surprisingly the dbf import options in access won't do it.
 
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Did you try to install the Focpro 2.6 on your PC ?
Then the standard import using filetype .dbf might work like it did for me.

Nic;o)
0
 

Author Comment

by:geraintcollins
Comment Utility
Yes but I keep getting the error message "external table not in the expected file format" when I try importing the dbf.
0
 
LVL 1

Assisted Solution

by:CharlesWard
CharlesWard earned 20 total points
Comment Utility
Hope this will help you - there are not many of us long-time xBase programmers left around however I still create massivly large systems to handle factories and state-wide systems using Foxpro because it is un-surpassed in my experience.

Answer:  Solution 1

You can try exporting the data to Excel.  For example in Foxpro 6.0+ you can use the following syntax:

Use ???      && The ??? is replaced with the name of the database/table you want to open
Export to C:\DataOut Type XLS      && This will export the data to an Excel spreadsheet called C:\DataOut.XLS

you can then import the data in Access from the excel database.  


There are other types of export options as well:

DIF  
Each field from a Visual FoxPro table becomes a vector (column) and each record becomes a tuple (row) in a DIF (Data Interchange Format) file, used by VisiCalc. The new file name is assigned a .DIF extension if an extension isn't included in FileName.

MOD
Use the MOD clause to export to a file in Microsoft Multiplan version 4.01 MOD format. The new file name is assigned a .MOD extension if you don't include an extension in FileName.

SYLK
A Symbolic Link interchange format (used by Microsoft Multiplan) in which each field from a Visual FoxPro table becomes a column in the spreadsheet and each record becomes a row. By default, SYLK file names have no extension.

WK1
Include this option to create a Lotus 1-2-3 spreadsheet from a Visual FoxPro table. A .WK1 extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 2.x. Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a spreadsheet row.

WKS
Include this option to create a Lotus 1-2-3 spreadsheet from a Visual FoxPro table. A .WKS extension is assigned to the spreadsheet file name for use with Lotus 1-2-3 revision 1-A. Each field from the table becomes a column in the new spreadsheet, and each record becomes a row in the spreadsheet.

WR1
Include this option to create a Lotus Symphony spreadsheet from a Visual FoxPro table. A .WR1 extension is assigned to the spreadsheet for use with Symphony version 1.01. Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a row in the spreadsheet.

WRK
Include this option to create a Lotus Symphony spreadsheet from a Visual FoxPro table. A .WRK extension is assigned to the spreadsheet file name for use with Symphony version 1.10. Each field from the table becomes a column in the new spreadsheet, and each record in the table becomes a row in the spreadsheet.

XLS
Include this option to create a Microsoft Excel worksheet from a Visual FoxPro table. Each field in the selected table becomes a column in the worksheet, and each table record becomes a row. An .xls file name extension is assigned to the newly created worksheet file unless you specify a different extension. You can export a maximum of 65,535 rows, which includes one row reserved for the field header.

XL5
Include this option to create a Microsoft Excel version 5.0 worksheet file from a Visual FoxPro table. Each field from the currently selected table becomes a column in the spreadsheet and each record becomes a row. An .xls extension is assigned to the new worksheet if you do not include a file extension. You can export a maximum of 65,535 rows, which includes one row reserved for the field header.


Answer: Solution 2

The other option is to create a small foxpro program to generate either a flat ASCII text file or a CSV file by using the FOPEN, FPUTS and the FCLOSE commands.  

For example - suppose that you have a table with three fields called "Field1, Field2 and Field3"

FileHandle = fCreate ( 'C:\DataOut.TXT' )     && Create A Text File called C:\DataOut.tXT
Select A
Goto Top
Do While EOF() = .F.    && Old School Syntax - we use SCAN/ENDSCAN now a days
     fResult = fPuts ( fileHandle, A->Field1 + '  ' + A->Field2 + ' ' + A->Field3 )    && Output a string
     Skip
EndDo
fResult = fClose ( FileHandle )   && Close The Test File

Of course this will not account for other data types - this example is for Strings only - but if you had numbers you could replace with Str( A->Field2, 10 ) or Str(A->Field2, 10, 4) to indicate a number 10 digits long or a number 10 digits with 4 decimal places.

Hope This Helps.
0
 

Author Comment

by:geraintcollins
Comment Utility
Thanks for the information.  I found that the problem was due to a foxpro numeric column containing non-numeric data.  I changed the data type to character and it imported.  I'll distribute the points accordingly.
0
 

Author Comment

by:geraintcollins
Comment Utility
had to increase the points to split them three ways
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now