CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    DAO Recordset. Needs resetting?

    Hi all. I'm using VC++ 6 with CDaoRecordset in a Dialog based project to access MS Access query which returns part numbers and descriptions of products. I'm using the Find member function to search by part number, which works great. The trouble is when I do a wildcard search by description. Descriptions are CString's and the code looks like this:

    UpdateData(TRUE);
    CString str;
    str.Format("[ItemDescription] Like '%s*'", m_Set.m_ItemDescription);
    m_Set.FindFirst(str);
    UpdateDataData(FALSE);

    The problem is that it works great for the first search but it doesn't work anymore after that without closing and restating the program. I tried calling MoveFirst to go back to the top of the recordset and I also tried calling Close() then Open() but nothing seems to work. Any help is greatly appreciated.




  2. #2
    Guest

    Re: DAO Recordset. Needs resetting?

    Hi,

    try using the following:

    while( m_Set.FindNext( str ) != 0 )
    {
    etc.
    }

    hope this helps,

    Daniel


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured