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

Need help with Seek() Command

Status
Not open for further replies.

hjohnson

Programmer
Aug 1, 2001
90
US
When I issue a seek() command, the record point goes to eof and remains there.

Example: seek('John','Customer','custname')

If I browse, the record pointer is locked on the very last record. I can't move to another record. If I exit Foxpro and came back, it removes the lock, but closing and re-opening the table doesn't change. Is there a setting somewhere that I may be overlooking.

Please help, I'm desperate.
 
hjohnson

As an observation, I would suggest where you are indexing on character fields, you index on UPPE(expr), and then:-

llFound = SEEK(UPPE([John]),[CUSTOMER],[custname])
? llFound

As to the specific query, what more can you tell us about the table in question and your setup in general, as it has not been possible to replicate your problem?

Chris :)
 
What I have done is create a case statement with several seek() command. As soon as it =.t., the table seems to lock on that particule record. If I brows, I can't move forward or back in the table

mvinput=upper(mvinput)

do case
case Seek(alltrim(mvinput),'ML','ML')=.t.
......
case Seek(alltrim(mviinput),'ML','MLNAME')=.t.
......
 
hjohnson

What happens if you run the individual case statement from the command window, FI?

Chris :)
 
If I browse, the record pointer is locked on the very last record. I can't move to another record. If I exit Foxpro and came back, it removes the lock, but closing and re-opening the table doesn't change

Sounds more like a damaged index.
I would record the index information
(disp stat)
close the dbf
delete the cdx
reopen the dbf exclusive
reindex the file

then see if the same thing happens David W. Grewe
Dave@internationalbid.com
 
Hi: I have built a 4 field table with one simple index and have had the same type of problem. . ."damaged index". . .I deleted the table and started over! and it now has happened the second & third time. . .(especially after entering data!) can't imagine why that is doing this to me.

Dave writes: "Sounds more like a damaged index. I would record the index information (disp stat)close the dbf delete the cdx reopen the dbf exclusive reindex the file"

"how do you delete an index and reindex a table?"

Could you paste a sample of that type of code?

Thanks,


Bill
 

this routine is written arount a table called sysindex.
It opens the sysindex table scans the table
each record is a database that needs reindexing
it deletes the cdx and rebuilds it.
The routine has 2 methods of doing it .
The old fashion way with a Dsip Stat to a txt file and then reads the text file
or
with the new VFP commands built around cdx files.

hope it helps you David W. Grewe
Dave@internationalbid.com
 
Thanks David, deeply appreciate your response! Bill :=)
 
Verify if it is any
SET EXACT ON
command in your program.
Another cause of your problem could be
SET DELETED ON
in combination with some indexes(specially with UNIQUE clause).
Finally you must verify if the index key is involved in a relation with another parent/child table .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top