9 |
The LA Fox Developer Newsletter
|
September 1998
|
FoxPro Q&A
(Con’t from page 7)
How do / troubleshoot the error message ‘illegal Seek Offset’?
This error means that FoxPro is trying to position a File Pointer beyond the end of the file or before the beginning of the file.
This usually occurs in large databases, when you use the SEEK command to find a particular record. The most common reason for this error is that the Index files are corrupted.
To resolve this problem:
Delete all the index tags using the DELETE TAG ALL and create the Index file again. Don’t use the REIN DEX command because this does not recreate the Index file header that may also be corrupted.
In Visual FoxPro, when you issue DELETE TAG ALL on a table that belongs to a DBC, all the relations this table was involved in will be deleted. So you will have to set them back programmatically. To add relations programmatically use the ALTER TABLE command with the ADD and REFERENCES clauses.
How can I group Child Records from
two
different tables in a Report?
Suppose you have a parent table, say CUSTOMER that has two or more child tables, say INVOICES and CONTACTS and you want to create a report from the tables given below.
CUSTOMER ABC Company 123 Main St. (Parent record)
CONTACTS John Doe (Child record) Jane Doe
INVOICES (Child record) 12345 Widgets, 67890 Things
Here’s what you can do:
‘First, create a dummy table with two memo fields:
CREATE dummy (childi m, child2 m)
APPEND BLANK
‘Now, do a SELECT from the parent table, joining the two memo fields:
SELECT
*
FROM parent,dummy INTO TABLE rpttbl
‘Now you have a table just like the parent table, but with two memo fields to hold related info from the children
INDEX ON keyfield TAG keyfield
‘Here we create a CDX for the rpttbl
SELECT childi SET ORDER TO TAG keyfield
SET RELATION TO keyfield INTO rpttbl ADDITIVE
SCAN
(Con’t, page 4)
|
is so fast, why don’t we throw some more data at it? Something along the lines of 200,000 users and 7 million or so demographic answers.
Frankly I think they were growing tired of my snide remarks about FoxPro’s abilities and wanted to bring Fox to it’s knees. They were greatly disappointed when the processing on 7 million records only took 10 seconds.
In the end the client gets an application that runs 2000% percent faster on 20 times as much data. Another happy customer. Another successful FoxPro application.
It Can’t Get Any Easier.......
We’ve come up with an easy way to submit articles to the
LA Fox
Developer Newsletter
one that has been overlooked for a long time.
You can submit your articles to Barry Lee at CIS# 72723,3422 on Compuserve, or
brlee@earthlink.net.
These articles can be on any FoxPro-related topic, whether it concerns a new technique you’ve discovered, a certain development technique you may favor over others, book reviews, etc. Editor reserves the right to edit or offer constructive comments concerning submitted articles and accepted articles shall be considered to be in the public domain.
The quality of this newsletter really depends on the members that support it, not just read it. And I think we’d all be surprised by the useful information that could be circulated around the membership.
|
(Ed. Note: Todd Landrum is an independent developer in Evergreen, Colorado. He’s also easily pressured into writing newsletter articlescg>. He can be reached as paladin@ecentral .com]
|
Page 9
|
9 |