|
Posted by Steve Jorgensen on 11/15/17 11:29
On Sun, 16 Oct 2005 20:19:38 GMT, "Neil" <nospam@nospam.net> wrote:
>
>"Steve Jorgensen" <nospam@nospam.nospam> wrote in message
>news:efc5l11ce6uhrccnbvj175duf936us2nac@4ax.com...
>> The problem might actually be your combo box. The combo box holds locks
>> on
>> the server side until its last record has been read. If you go to the
>> last
>> row in the combo box (or ask for its list count in code) the locks are
>> released.
>
>Well, I think you've hit the nail on the head. I tried it with a text box,
>and the problem wasn't there. That also explains the last-fast-first-slow
>phenomenon, which I found very puzzling. Thanks! (I have to admit that I
>posted this sort of like a message in a bottle, without much hope that
>anything would come from it. Needless to say, I'm overjoyed here.)
>
>> If you don't access slowly populates list items in the background,
>> and can take a very long time to complete, even if the number of rows is
>> small, but especially if it is large.
>
>I think you forgot a noun or a verb in the above, so I don't really
>understand what you're saying. Could you rephrase it?
I was missing a comma. To rephrase... If you don't read the whole list by
selecting the last row in the combo box or by getting its list count, Access
will slowly retrieve the combo box rows in the background, it may take a very
long time, and some locks will be held for duration. Locks can be held for a
long time even by combo boxes with fairly few rows.
>
>I'll just note that I didn't consider the combo boxes because the two forms
>were identical, and I didn't recall changing anything there. So when I
>compared the two forms, I only compared the code modules and the form
>properties. I didn't examine the combo box properties.
>
>However, in light of the above, I took a closer look at the combo boxes,
>since, even though your explanation makes sense, it doesn't explain why go
>to's are always fast on the new version of the form, even with the combo box
>there. So I took a look at the two combo boxes, and, on the new version of
>the form, where there's no problem, that combo box is *not* set to limit to
>list, whereas the original one was. (I must have changed it as I was working
>with the form.) So, apparently, that's the difference.
>
>To confirm this, I went into the new version of the form, set the combo to
>limit to list, and, voila!, it was slow like the other. Then I changed it
>back to not limit to list, and it was fast again.
>
>So I'm relieved to know that it's not a gremlin that's causing this.
>
>Thanks again for your help.
>
>Neil
>
>
>>
>> On Sun, 16 Oct 2005 19:10:46 GMT, "Neil" <nospam@nospam.net> wrote:
>>
>>>I have a very puzzling situation with a database. It's an Access 2000 mdb
>>>with a SQL 7 back end, with forms bound using ODBC linked tables. At our
>>>remote location (accessed via a T1 line) the time it took to go to a
>>>record
>>>was very slow. The go to mechanism was a box that the user typed the index
>>>value into a combo box, with very simple code attached:
>>>
>>>with me.RecordsetClone
>>> .FindFirst "[Index] = " & me.cboGoTo
>>> If Not .NoMatch Then
>>> Me.Bookmark = .Bookmark
>>> End If
>>>end with
>>>
>>>Now, one would say that going to a record is slow because I'm using
>>>.FindFirst over a T1 line. And that's what I thought. However, as I was
>>>working with the form, commenting out various sections not related to the
>>>Go
>>>To, I found that the Go To functionality changed, though I didn't modify
>>>the
>>>code.
>>>
>>>Previously, going to a record near the end of the 50,000 record recordset
>>>took about 1-2 seconds, but going to a record near the beginning, took
>>>about
>>>20 seconds. After the form changed, going to any record in the recordset
>>>took about 1-2 seconds.
>>>
>>>So the question remains: why did it take so long to go to a record near
>>>the
>>>beginning of the recordset, but not near the end (and the ones in the
>>>middle
>>>took an amount of time about halfway between the two), and what changed so
>>>that now the form is working fine for all records?
>>>
>>>I've compared the changed form with the previous copy, and I don't see any
>>>differences. I've compared all code in the form module, and I've compared
>>>all form properties. The forms are identical as far as I could tell. But
>>>something happened as I was commenting/uncommenting code in the form that
>>>got rid of the problem with it taking a long time to go to some of the
>>>records.
>>>
>>>My first thought was that something got recompiled, and now the form is
>>>fast. So I went back to the original version and changed some code and
>>>recompiled, also did a compact and repair. But it was still slow. I also
>>>tried doing an explicit decompile and then recompiled it. But it was still
>>>slow.
>>>
>>>So this is very frustrating that the form is now working fine, but I can't
>>>see anything that's changed. If I don't see why the form is now fast, then
>>>there's no reason to believe that it might not at some point go back to
>>>being slow again. And then I'd just have to hope that something changes.
>>>It
>>>would be good to figure this out.
>>>
>>>Any ideas as to what might have changed here to cause the form's Go To to
>>>be
>>>fast would be appreciated.
>>>
>>>Thanks,
>>>
>>>Neil
>>>
>>
>
[Back to original message]
|