使用sql语句过滤listview中的记录。 [英] Filter records in listview using sql statement.

查看:89
本文介绍了使用sql语句过滤listview中的记录。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个使用listview作为我的datagrid的VB6项目。到目前为止,我成功地添加,编辑,删除和刷新表(我在谈论列表视图)。我现在的问题是搜索或过滤记录。这是我刷新桌面的代码。我正在考虑将它作为过滤记录的基础。事件。我在我的sql语句中添加了where子句,但是我的listview表中没有出现任何记录。任何人都可以知道如何使它成为可能吗?

I am creating a VB6 project that uses listview as my datagrid. So far I am successful in adding, editing, deleting and refreshing the table (I''m talking about the listview). My problem now is to do searching or filtering the records. This is my code on refreshing my table. I am thinking to use it as basis in doing the "filter records" event. I have added where clause on my sql statement but there is no record appearing in my listview table. Can anyone out there know how make it possible?

展开 | 选择 | Wrap | 行号

推荐答案

不确定我'我理解这个问题100%,但听起来好像你刚刚弄错了WHERE子句。你能告诉我们吗?
Not sure I''m understanding the question 100%, but it sounds as though you just got the WHERE clause wrong. Can you show it to us?


这段代码实际上附在我的cmdSearch按钮中。我认为这种说法是正确的。我现在的问题是我的SQL语句之后的代码。它实际上是一个运行代码,但它不显示任何记录。我还使用了整个代码来刷新listview表中的记录。它显示记录集中的所有记录。显示所有记录没问题。问题是过滤记录。我的意思是,我想基于txtsearch文本框搜索特定记录。希望你理解。


This code is actually attached in my cmdSearch button. I think this statement is right. My problem now is the code after my SQL statement. It is actually a running code but it displays no records. I also used this whole code to refresh the records in my listview table. It displays all the records in the recordset. No problem in displaying all the records. The problem is filtering the records. What I mean is, I want to search particular records based on the txtsearch textbox. Hope you understand.


展开 | 选择 | Wrap | 行号


对不起,我还是有点不清楚。你是说没有WHERE子句它显示所有记录,而WHERE子句它显示没有?
Sorry, I''m still a little unclear. Are you saying that without the WHERE clause it shows all records, and with the WHERE clause it shows none?


这篇关于使用sql语句过滤listview中的记录。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆