Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table will not lock
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01025980
Message ID:
01026063
Vues:
26
Thank goodness no one will ever ask me to count the number of times I have overlooked something silly and basic in this development language that I have used since the mid 80s. I couldn't count them all! Thank goodness for Sergey. :0)

Glad you found it.

>The simple test in your previous post set me in the right direction, and reminded me what a hassle it can be to get a new machine! The param file has only 1 record. I didn't notice that it was toggled for deletion. Still setting up the environment on a new machine and set deleted on had not been added to my defaults. The test program made me look harder at what was happening, and I found that if there is no record, you can't lock the record. Of course FLOCK worked, but found no data to read from. And staring at the maintenance screen with it's 0's and blanks and disabled edit button finally kicked me into realizing what had happened. Now to figure out how the record got toggled for deletion between yesterday afternoon and this morning, when there is no one in the IDE but myself. And I have other things to do and haven't looked at the code or tables for days.
>
>Thanks for the pointers, and even though I feel silly because it was something so simple and obvious, I feel better because it was something so simple and obvious.
>
>>What does the test below return? You don't have any buffering turned on or anything like exclusive = ON in the config.fpw, right? Is multilocks on or oFF?
>>
>>
>>SET REPROCESS TO 5 SECONDS
>>SET EXCLUSIVE OFF
>>SET MULTILOCKS ON
>>SELE 0
>>USE CDM05RPM     && hope name is correct
>>IF USED("CDM05PRM") .and. !EOF("CDM05PRM") .and. recno("CDM05PRM") > 0
>>   WAIT WINDOW "Last number used was: " + ALLTRIM(STR(MEMLASTWO))+ ".  Press anykey to lock record ..."
>>   IF RLOCK()
>>      WAIT WINDOW "Locked record successfully. Press anykey to get new value..."
>>      IF !EMPTY(MEMLASTWO)
>>         new_wo = MEMLASTWO + 1
>>      ELSE
>>         new_wo = 1
>>      ENDIF
>>      REPLACE NEXT 1 MEMLASTWO WITH new_wo
>>      REPLACE NEXT 1 MEMLASTRR WITH new_wo
>>      unlock
>>   ELSE
>>      wait window "Unable to lock record to get next wo number. Press anykey..."
>>   ENDIF
>>ELSE
>>   WAIT WINDOW "Unable to open CRM05RPM.  Press anykey..."
>>ENDIF
>>IF USED('CDM05RPM')
>>   USE IN CDM05RPM
>>ENDIF
>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform