Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run Time Primaey index corrupts.
Message
From
02/12/2002 09:46:56
 
 
To
29/11/2002 06:22:23
James Hill
Jim Hill Productions
Halifax, Nova Scotia, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00728134
Message ID:
00728579
Views:
24
PMFJI, but it looks like the code that you are using is adding a new record each time that a bid is entered instead of replacing the existing bid in the same record. Is it possible that the oApp.incrid( m.lcNaCurKey ) is returning a duplicate key causing not a corrupted index (which could not be reverted), but a duplicate key value for the primary key being inserted (which can be reverted.)? If this is happening in a multiuser environment but not standalone, I would check for cacheing of data in the table that the oApp.incrid function is using, causing duplicate keys. You might need to flush cached data in this function to flush any changes to disk before someone else tries to get a new ID. Just a SWAG.

HTH

>I am caught between a rock and hard place, with only 24 hourse to find a resolution. I have also posted this Microsoft Fox Programmer exchange, but so far received no replies.
>Here is the problem.......
>I have, as part of an application, an 'Auction' module. When compiled and
>run as an executable it works perfectly, but when it is run as part of a
>'Run Time' created by Install Shield Express it corrupts the Primary Key
>index (cidAuct).
>The concept is simple. An entry is made into the 'Auction' table, given an
>Item Number and description. If there is no 'Reserve' value placed on the
>item at the time of entry, the value is set at zero. The program will only
>accept bids greater than the current bid (anything equal or less is
>rejected). All the user can do is to update the bid amount and enter the name and
>phone number of the bidder. The user's name and the time of the bid is
>automatically entered.
>The user cannot alter or add any further items. The code for the update is
>below. I surely need some help in solving this problem.
>TIA
>
>(update code)
>LOCAL m.lcOriWA
>m.lcOriWA = _SCREEN.ACTIVEFORM.primarytable
>SELECT &lcOriWA
>LOCAL lcNaTable, lcNaCurKey, lcNewKey
>PUBLIC nAmount, cName, cCode, cPhone
>m.lcNaTable = ALIAS()
>m.lcNaCurKey = "cIDAuct"
>m.lcNewKey = oApp.incrid( m.lcNaCurKey )
>IF !EMPTY( m.lcNewKey )
> DELETE
> SET CARRY TO nitem_num, citem
> INSERT INTO &lcNaTable (&lcNaCurKey,nitem_num,citem,nAmount, ctime) VALUES
>(m.lcNewKey,nitem_num,citem,nAmount, TIME())
> =TABLEUPDATE(.T.)
> _SCREEN.ACTIVEFORM.REFRESH()
>ELSE
> =MESSAGEBOX("Record not added")
>ENDIF
>THISFORM.pgf2base1.page1.txtnBid.SETFOCUS
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform