List:MySQL ODBC« Previous MessageNext Message »
From:Patrick Sherrill Date:December 5 2001 12:39pm
Subject:Re: MFC CRecordset / MyODBC
View as plain text  
For the first issue, you can either set up a thread to load your data or if
you are using DAO Recordsets you could use the SetCache methods to improve
performance (this is essentially what the Access program does).  Here is a
code snippet that would be place in your OnInit or OnInitialUpdate class:

  m_pSet = &GetDocument()->m_realtySet;
  CDaoRecordView::OnInitialUpdate();
  OnMove(ID_RECORD_FIRST);
  COleVariant firstRecord= m_pSet->GetBookmark();
  m_pSet->SetCacheStart(firstRecord);
  m_pSet->SetCacheSize(300);
  long numRecs = m_pSet->GetRecordCount();
  if (numRecs>300) numRecs=300;

  CProgressDlg dlg;
  dlg.Create();
    numRecs = (long )(numRecs *(1/10));
    for(int i=0; i<10; i++)

   {
  if(dlg.CheckCancelButton())
    if(AfxMessageBox(_T("Are you sure you want to
Cancel?"),MB_YESNO)==IDYES)
   break;
  m_pSet->FillCache(&numRecs);
  dlg.StepIt();
    };

In the example m_pSet is defined and declared in the your Document class
(assuming Doc/View project).

I hope this helps...

Your more important issue strains my memory, but I know I resolved this
several years ago. Unfortunately, I can't remember the solution.  I keep the
wheels grinding.

Pat...
patrick@stripped


----- Original Message -----
From: "ac" <achmiel@stripped>
To: <myodbc@stripped>
Sent: Wednesday, December 05, 2001 4:13 AM
Subject: MFC CRecordset / MyODBC


> I just migrated from Access2000 to MySQL and had to change quite an amount
> of sourcecode to fit the new needs. I work with VC++ 6, MyODBC 3.70 and
> MySQL 3.23. There's two point leaving me desperate:
>
> 1. In Access, when opening a database without a filter, I get instant
> access. IN MySQL, it may take several seconds, depending on the size of
the
> table. Obviously, MySQL is reading the whole table onto my machine. Any
way
> to change that?
> 2. (MORE IMPORTANT!) Every now and then I get this message (in german):
"Es
> waren keine Zeilen von der Aktualisierungs- oder Löschoperation betroffen"
> which means (sort of): "NO rows affectec by Update or delete".
>
> This problem occurs with no for me logic reason on some recordsets, not on
> all though, and also not every time, just sometime. It appears no matter
if
> there actually was a change in the recordset or not, doesn't matter.
>
> I believe this is an error MyODBC is sending me, so how can I turn it off
> and just let MySQL overwrite the recordset? Please help, I'm lost!!!
>
> Thanks in advance.
> Alex
>
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail myodbc-thread4283@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail myodbc-unsubscribe@stripped instead.
>

Thread
MFC CRecordset / MyODBCac5 Dec
  • Re: MFC CRecordset / MyODBCPatrick Sherrill5 Dec