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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INDEXSEEK Response Time

Status
Not open for further replies.

SGLong

Programmer
Jun 6, 2000
405
US
I'm running into a really strange problem and was wondering how VFP keeps up with wide area network traffic. I am performing a filtered INDEXSEEK. The index tag OKTOBILL is defined as "INDEX ON version_id FOR EMPTY(mailed_on)" where version_id is C-5 and mailed_on is a date field. There are approximately 2,400 records in this table. The command that is 'failing' is: llFound = INDEXSEEK(lcVersionID,.T.,"BILLING","OKTOBILL"). The VFP exe is located at a plant approx. 1,000 miles away, but we are connected by a T-1. Occasionally the INDEXSEEK is returning .F. even though the proper record exists.

My question is, if network response time is slow, can VFP "get ahead of the network" and presume that the indexseek failed because it didn't get a response in the time that expected to?

Steve
 
I would suspect a bad index rather than a delay in response time being the culprit. How are you verifying the record should be found? SEEK would return a bogus value too, but with no index order set LOCATE should return a good record. That would probably determine a bad index. At my office, we do a lot of T-1 stuff and bad response time usually produces a runtime error like "File read error" or something like that.

Dave S.
 
Dave,

With regards to "How are you verifying the record should be found?", one of the earlier applications that runs for this job is the only one that has the ability to insert a record into the billing table. All other applications just update the record with specific values. I've inspected the file each time the error has been reported and the proper record is there, it just hasn't been updated.

I was thinking about a bad index file as the culprit, but with a WAN in multiple plants from North Carolina to California almost always logged on it's going to be tricky getting exclusive access to the file in order to rebuild it.

Steve
 
I understand. Something I have done in the past, is verifying the SEEK() or INDEXSEEK() is actually doing it's job since corruption happens so easily. Try something like:

Code:
SET ORDER TO 
llFound = INDEXSEEK(lcVersionID,.T.,"BILLING","OKTOBILL")
IF llFound
   IF EMPTY(mailed_on)
      *... continue processing
   ELSE
      WAIT WINDOW 'Error'  TIMEOUT 2
   ENDIF
ELSE
   SELECT billing
   LOCATE FOR EMPTY(mailed_on)
   IF EOF()
      WAIT WINDOW 'No records' TIMEOUT 2
   ELSE
      IF EMPTY(mailed_on)
         *... continue processing
      ELSE
         WAIT WINDOW 'Error'  TIMEOUT 2
      ENDIF
   ENDIF
ENDIF

Locate can slow things down a little, but it can sometimes be a good trade-off.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top