ODBC and Access 2000 too slow

ODBC and Access 2000 too slow

Post by Christian Behren » Thu, 25 Oct 2001 15:54:36



Hi Newsgroup,

I want to select some rows from a Access-Database with class CMyRecordset
(derived from MFC-Class CRecordset).

I use code like this (for a simple SELECT-Statement):
  int IsDone = MyRecordset.Open(CRecordset::snapshot,
                                "SELECT A.VERSNR FROM AVDB A WHERE
A.SAMMELNR LIKE '00000';",
                                CRecordset::readOnly);

  if (IsDone)
  {
    if (!MyRecordset.IsBOF())
         MyRecordset.MoveFirst();
      do
      {
        // do anything with the data
        if (!MyRecordset.IsEOF())
             MyRecordset.MoveNext();
     } while (!MyRecordset.IsEOF());
  }
  MyRecordset.Close();

As result, I get several lines of the database. The result is correct, but
after processing the last result-line, IsEOF() returns false, so MoveNext()
is called but does not find a next entry. And this last call of MoveNext()
is too slow for doing serious work with my application.
The same coding works fine (and fast!) with Access 95.

Any ideas whats wrong?

Christian

 
 
 

ODBC and Access 2000 too slow

Post by Christian Behren » Fri, 26 Oct 2001 04:29:02


Christian Behrens schrieb:

Quote:> Hi Newsgroup,

> I want to select some rows from a Access-Database with class CMyRecordset
> (derived from MFC-Class CRecordset).

> I use code like this (for a simple SELECT-Statement):
>   int IsDone = MyRecordset.Open(CRecordset::snapshot,
>                                 "SELECT A.VERSNR FROM AVDB A WHERE
> A.SAMMELNR LIKE '00000';",
>                                 CRecordset::readOnly);

>   if (IsDone)
>   {
>     if (!MyRecordset.IsBOF())
>          MyRecordset.MoveFirst();
>       do
>       {
>         // do anything with the data
>         if (!MyRecordset.IsEOF())
>              MyRecordset.MoveNext();
>      } while (!MyRecordset.IsEOF());
>   }
>   MyRecordset.Close();

> As result, I get several lines of the database. The result is correct, but
> after processing the last result-line, IsEOF() returns false, so MoveNext()
> is called but does not find a next entry. And this last call of MoveNext()
> is too slow for doing serious work with my application.
> The same coding works fine (and fast!) with Access 95.

> Any ideas whats wrong?

> Christian

Hi all,

debugging the class CRecordset I have noticed, that the member
CRecordset::FetchData() calls the function ::SQLFetch, which is rather slow, if
the cursor is already positioned on the last record.
Any ideas?

Christian

 
 
 

1. Access frontend Sql 2000 Server ODBC - Access Form loading slow

Hi all and I wonder if anyone can help me with this delimma:

I have been given the privilege of increasing the loading performance
on an Access form. Presently the form takes 5 mins to load!! The form
to begin with, has approximately 20+ combo boxes, tab control yada
yada. Im connecting to a server via Terminal Services and running the
front end on the server box. This scenario was pre-made, not my idea
but this is where I have to start from.
The Access frontend interacts with a SQL 2000 Server using ODBC
driver. What I have started to do is first off try to remove
'overhead' on the Access form such as limit loading sub forms and
deciding if all queries are really necessary on the Form_Open() call.
Is this a good starting point?
I finally got the main section of the Access form to load in
approximately 20 seconds and I did this by removing sections of the
form and making them separate forms. My idea is having these sub forms
load on button clicks. Is this a good approach? Once the main section
of the form does load, upon clicking combobox dropdowns, the choices
are listed but as I choose one the frontend lags again for
approximately 20-30 seconds.
I did notice that one of these sub forms did take quite awhile to load
due to it containing a calendar .ocx (for scheduling). From what I
have read, it isn't best to execute a frontend off a server and every
pc should contain the frontend and even registering the .ocx's.
Experts tell me if I am wrong please!

I am merely concerned about the design of this client/server app and
any help would be greatly appreciated.

  Thanks in advance!!

2. Spell Checker

3. ODBC + SQL 2000 Service Pack 3 Slow Down

4. US-DE: Wilmington-Sr Oracle DBA

5. + * + = ?

6. Slow ODBC Connection to IDS 9.30 on SUN 5.8 from Windows 2000

7. About Open Cursor

8. Pervasive SQL 2000 and slow ODBC

9. linking Pervasive.SQL 2000 and MS Access 2000 via ODBC - problem

10. Access 2000 and Pervasive SQL 7/2000 ODBC Driver Problems

11. access Access 2000 vio jdbc-odbc bridge ?? code

12. Access 2002 / Access 2000 - Linking via ODBC on local machine