Solved

Combo/List Box that recognizes a filtered ADO recordset

Posted on 2001-09-10
8
425 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
Comment Utility
Hope you can use WHERE condition for your recordset, and use it datacombo or datalist, instead of using filter.
0
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
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
Comment Utility
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
 
LVL 9

Expert Comment

by:Valliappan AN
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:columbasteve
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
Per recommendation, points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
vb6 programatically bring window to front 8 52
DIR issue 7 45
VB error "Type mismatch" 2 42
using Access 8 52
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now