Link to home
Start Free TrialLog in
Avatar of TheAnswerMan
TheAnswerMan

asked on

VB- ACCESS

I have an app that load 75000 records into a grid.
<Dont ask me why>

The Grid is bound to a Data Control.
VB3.


When i try making the same form in vb6.  using ADO data control.. its all good.. but the form takes like 8 seconds to load up..  
understandably.. as there are alot of records.

but in the VB3 App.. the form just pops up like that are 100 records. really fast.

The SQL statements are the same.  "Select * from MyTable "

I will note that in the VB3 app.. as i scrolled down the list.. there were pauses.. as if it was fetching the data..
Kind of like SQL Server Enterprise manager does.. or access..

Anyone know why this behavior is happening?
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

You could set the .cachesize property of the data control in order to restrict the number of records locally loaded in memory.
ASKER CERTIFIED SOLUTION
Avatar of Valliappan AN
Valliappan AN
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might link your grid to recordset, by setting the datasource property, of the grid to recordset.

Or, I am not sure, the datacontrol, has such a property, for Async Retrieval.

Avatar of TheAnswerMan
TheAnswerMan

ASKER

I am not asking about how to optimize my query.

The current VB3 app connects with the same SQL and appears to be 10 times faster.

I say appears.. becasue as I scroll through the VB app.. it appears to fetch the data.. kind of like opening a table in SQL Server Enterprise manager.

Ie: it opens right up.. but to see the last records.. you
have to pull the scrollbar all the way down a few times.


the VB6 App.. appears to fetch all the records.. and THEN put them into the grid.

The VB3 app.. appears to getch a few records... and when i scroll down the list.. the grid is initiall blank.. and then fills up with the data.. as if if fetched it from the server.

There is no code to do this fetching.. just a bound grid.
We had a similar problem using recordset as datasource for datagrid in VB6, when number of records is more.

So, we used the AsyncFetch option, which is meant to do some fetch (I hope, as per InitialFetchSize), and then allowing for other activities, when it retrieves further, if I am right.This is the part, we changed.(Note the last parameter, which does what you are telling about, in VB3.0, if I am right.)

Set rs = New Recordset
rs.Open "Select * From MyTable",Conn1,adOpenKeySet,adLockOptimistic, adAsyncFetch

For its correct usage, check this link:
http://support.microsoft.com/support/kb/articles/Q224/3/32.asp

The reason of speed difference could be, as I hope, that VB3 used DAO and in VB6, you use ADO, which is still a new technology, while DAO had undergone several changes in VB versions.

Hope this helps.
appreciate the help everyone.. but was asking about why VB3 Code was appearing to fetch the data instantly.. but not really, as when you scrolled.. it appeared to "fetch" the data.

I used the same exact code for the vb6 project.. except ADO control instead.

Avatar of DanRollins
Hi TheAnswerMan,
You've requested to delete this question, but its status has remained as 'Pending Delete' because one or more comments have been added.  Normally, the only way to fully delete such a Question is to post a message to Community Support and ask for assistance.

EE is making a one-time database sweep to purge the Pending Delete Questions automatically.  During this sweep:

    TheAnswerMan -- To allow the deletion to proceed:  Do nothing.
    EXPERTS -- Please DON'T POST a comment except to contest this deletion.

In the future, please refer to https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#8 for instruction on deleting questions.

DanRollins -- EE database cleanup volunteer
As mentioned earlier, DAO (which you used in VB3) looks to be more faster than ADO, in case of Access, which is testified by many experts here.

Cheers.
Listening further for TheAnswerMan response.
Moondancer - EE Moderator
Moderator, my recommended disposition is:

    Accept valli_an's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

Computer101
E-E Moderator