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

help please with changing tag of a table 2

Status
Not open for further replies.

ron9999

Programmer
Feb 14, 2003
89
AT
Hi All,
I have a problem with changing the tag of a table in a db
The code is:

open Database plumber
use plumber!belege exclusive
set safety off
if !(tag(9)== 'belegid' and key(9) == 'val(alltrim(beleg_id))')
delete tag 'belegid'
Index on val(alltrim(beleg_id)) tag belegid
endif

If I call it from vfp via main.prg it works, but if I compile it and make a exe and call the exe it don’t works. The error is some like “ can’t update the cursor “
I open the belege exclusive what else must I do?
Tia
Ron
 
forget to say I open the db also exclusive
 

Ron,

Is it possible that you accidentally included the DBF (or DBC) in the EXE? Check the project manager. If it file does not have a little "exclude" icon against it, right-click and choose "Exclude".

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Mike,
thank your for this advice. The dbc was included and I excluded it, now i'm able to change the tags but now I get an other error like "the database is not valid, make a validity check" what could the reasen be for that.
tia
Ron
 
By the way, I wouldn't count on have a particular tag as a particular number in the index file. It's better to spin through and check for the tag you're looking for (or, in recent versions, use ATAGINFO() to put tag information in an array and search the array).

Tamar
 
Wouldn't this code
Code:
set safety off
Index on val(alltrim(beleg_id)) tag belegid 
set safety on
accomplish the same thing by overwriting the existing tag?
Is deleting the old tag necessary?

Mike Krausnick
Dublin, California
 
Tamar, thank you!
I did not know ATAGINFO() (you can't know all func but you schould know where to find it ggg)
loop and filter larray[1,1], larray[1,3]
if corrupt - delete all index and reindex and put the index to there position. super

10-15 years ago you show me a fast way how to check if table is empty - something with index deleted deleted()?
I don't know anymore. (I could not find it in your books)







 
The fastest way to check for an empty table is to check whether reccount()=0.

I used to recommend that you have an index on DELETED() for every table, but that turned out not to be good advice in the long run.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top