Solved

Combo/List Box that recognizes a filtered ADO recordset

Posted on 2001-09-10
8
428 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 50

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

831 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