Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Tue Mar 18 08:17:37 CDT 2008
Sounds like page locking instead of record locking. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Tuesday, March 18, 2008 12:34 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Array is locked Well here is another bug/feature. A3K Default Record Locking set to "Edited Record" Problem: Main form has 3 sub forms. Click button opens a new form. This new form has a click button which runs a function. Function opens a new recordset which requires records which are also held in one of the subform on the main form. All records in rst are parsed and updated (90k+ ) except for 97 records. Always the same 97 Turns Out: Turns out that one of the sub forms oncurrent event was making a record "dirty" (ie, changing a value as the record was accessed) and thus it was locked. Access (of course) locked this record but also the records around it (the other 96). It was not apparent that this was the problem as there was no way to "SEE" that the record was "dirty" as the forms were not displaying the indicators. Also difficult to pin down as Access of course "updated" and thus made "Clean" the record as the focus was moved. Lots of head scratching. Answer: In the last line of the oncurrent event for each of the subforms and the main form put in me.dirty=false. Also put this in just before the click button opened the function. That done the trick. So much for the Default Record Locking set to "Edited Record". 96 other records were locked as well. Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Monday, March 17, 2008 10:19 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Array is locked Is that a bug or feature? Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Monday, March 17, 2008 3:07 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Array is locked FYI: I figured it out - brute force, binary search - ReDimming various places in the module until I found where it failed. Turned out that if you use With/End with on the array, it's locked - and apparently stays locked for the duration of the module. Don't know if there's a way to unlock it. End With doesn't do it. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Monday, March 17, 2008 9:49 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Array is locked Arthur: I tried this: For lngI = 1 To UBound(mudTH) If mudTH(lngI).fOrdering = True Then If lngI <> UBound(mudTH) Then ' if not the last record in the TH array For lngL = lngI To UBound(mudTH) - 1 mudTH(lngL) = mudTH(lngL + 1) Next lngL End If lngDeletes = lngDeletes + 1 ReDim Preserve mudTH(UBound(mudTH) - 1) End If Next lngI 'If lngDeletes <> 0 Then ReDim Preserve mudTH(UBound(mudTH) - lngDeletes) Where before the first ReDim was commented out. I uncommented it and got the lock message first time .fOrdering was True. The rest of the code moves all the downstream elements of the array up one element to delete the current element. It's a legacy app and really one huge bowl of spaghetti. I'm thinking about going around the problems by substituting a variable lngUboundmudTH for everywhere the code uses UBound(mudTH) abd just reduce that variable in this case by lngDeletes. But finding all occurrences of UBound(mudTH) could be a problem since it might be in Control Sources, Record Sources, stored queries, almost anyplace. Like I say - legacy code. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller Sent: Monday, March 17, 2008 9:31 AM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Array is locked Just a wag, Rocky, but what if you ReDimmed the array element by element? It might be that something somewhere in the middle is causing the problem. You could easily find out whether the whole array is locked by just shrinking it one element. If that works then try the loop and decrement the size until she goes boom. Just a wag, as I said. Arthur On 3/17/08, Rocky Smolin at Beach Access Software <rockysmolin at bchacc.com> wrote: > > Lambert: > > Here's the Type: > > Private Type THRecord > TaskID As Long 'T > StartDate As Date 'S > DueDate As Date 'D > QuasiDueDate As Date 'Q > TargetDate As Date 'R > RequiredHours As Double 'H > EarliestCompleteDate As Date 'C > ASAP As Double 'A > fOrdering As Boolean 'F > ErrorHours As Double 'E > TempReg As Double 'Z > DueDateFlag As Boolean 'FD > PastDueFlag As Boolean 'FP > ASAPFlag As Boolean 'FA > TargetDateFlag As Boolean 'FT > End Type > Dim mudTH() As THRecord 'TH > > There are lots of references to elements in the aray but at the point > where the redim occurs, there are no references. Does any reference > lock the array and then the lock persists? Is there a way to > determine what element in an array is causing the lock or a way to > release the array? > > > TIA > > Rocky > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.7/1331 - Release Date: 3/16/2008 10:34 AM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.7/1331 - Release Date: 3/16/2008 10:34 AM -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.7/1332 - Release Date: 3/17/2008 10:48 AM