Solved

Combo/List Box that recognizes a filtered ADO recordset

Posted on 2001-09-10
8
432 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
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 51

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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

749 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