Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Combo/List Box that recognizes a filtered ADO recordset

Posted on 2001-09-10
8
Medium Priority
?
444 Views
Last Modified: 2008-02-01
Is there a 3rd party combo and/or list box that displays only the filtered rows of an ADO recordset.  The DataCombo and the DataList shipped with VB6 have an acknowledged by (by Microsoft) - they do not display the filtered row - they display the called recordset unfiltered.

Conversly, is there a workaround to display the filtered rows in the DataCombo or DataList.

This workaround must be for disconnected recordsets.

Thanks

With regard to the comment from Valli An suggesting using a SQL where clause - I think this would require a reconnection of the disconnected recordset.  I am trying to avoid this.  I already have the entire recordset on the client, and I want to display a filtered subset of this data.

0
Comment
Question by:columbasteve
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6473212
Hope you can use WHERE condition for your recordset, and use it datacombo or datalist, instead of using filter.
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6479421
Hi columbasteve,

Here is a example using ADODC Data Control:

Private Sub ChangeComboContent()
    On Error GoTo y
    With Adodc1
    If Text1.Text = "" Then
        .Recordset.Filter = ""
    Else
        '.Recordset.Filter = "Adv = '" & Replace$(Text1.Text, "'", "''") & "'"
        .Recordset.Filter = "Adv like '%" & Replace$(Text1.Text, "'", "''") & "%'"
    End If
    Combo1.Clear: List1.Clear
    If .Recordset.RecordCount > 0 Then
        For i = 1 To .Recordset.RecordCount
            Combo1.AddItem .Recordset.Fields!Adv
            List1.AddItem .Recordset.Fields!Adv
            .Recordset.MoveNext
        Next i
    End If
    End With
    Exit Sub
y:
End Sub

Private Sub Form_Load()
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\Desktop\EMAX Demo.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "Select * from Adv"
    Adodc1.Refresh
End Sub

Private Sub Text1_Change()
    ChangeComboContent
End Sub

'Hope will help.
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6480160
Hi, did you edit your question. Why dont you put a comment. I just now found that you have edited the question. You need not do that. Just add another comment. Thats it.

Ok, let me try out if there are some controls for displayhing filtered disconnected recordsets.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6480188
I think you have a workaround for using it in DataCombo or Datalist:

http://www.vb2themax.com/Item.asp?PageID=BugBank&ID=55
(DataCombo and DataList don't work with sorted, filtered and child Recordsets)

Hope it helps.
0
 

Author Comment

by:columbasteve
ID: 6483979
To ryancys

Thanks for you suggestion.  I am aware of this work around.  However, the problem is if I have a large table, which I do, all this copying takes too much time.  It would probably be faster to reconnect and use the SQL WHERE clause.  However, this too is unacceptable.  I have already retrieved the large table - I have filtered it locally - I guess the only solution is finding a third party List and/or Combo box that displays a filtered ADO disconnected recordset.

To valli an

Thanks for the suggestion of adding a comment.  Just joined and learning protocol. Not really sure yet how the point system works.

Re: workaround - see the comment above for ryancys.  If you have any luck finding third party controls I would appreciate any lead (I have looked also but haven't found anything yet).

Thanks to you both for your suggestions and trying to help.

columbasteve
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6484722
>>Thanks for the suggestion of adding a comment.  Just joined and learning protocol. Not really sure yet
how the point system works.

Welcome to EE. Have a look at:
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp

EE is a good site to share with. In this site, you are supposed to listen to comments and give continuous feedback, and accept the answer, if it suits you, or else you can ask the EE community support to delete it, if you dont get any useful comments or the comments did not solve your problem. In case you need to split points to multiple experts, it can be done, by giving a comment to Community support.

This is not like any other newsgroup, like you ask a question and dont respond.The points systems is an encouraging one, here.

And further, if you gain a good control, you can give answers to questions as an expert too.

Cheers
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7207880
Hi columbasteve@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

columbasteve@devx, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7241112
Per recommendation, points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question