Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Combo/List Box that recognizes a filtered ADO recordset

Posted on 2001-09-10
8
Medium Priority
?
450 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 54

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
Technology Partners: 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

876 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