MS Access VB.Net:如何在多列中搜索 [英] MS Access VB.Net: How to Search in multiple columns

查看:71
本文介绍了MS Access VB.Net:如何在多列中搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个会员项目,每年积累的会员记录。我创建了5个字段,最多5个学年,学生可以注册,以便用户可以搜索特定的学年,并且将显示拥有该特定学校
年(在所有5个字段中)的所有学生。如何创建一个能够搜索所有这5个字段的搜索按钮? 

We have a membership project and the records of members per year are accumulated. I created 5 fields for 5 maximum school years a student can register so that the user can search a particular school year and all the students who have this particular school year (among all 5 fields) will be displayed. How can I create a search button that would be able to search through all these 5 fields? 

推荐答案

您好,

您是否尝试在MS-Access中编写SQL SELECT语句?

Have you tried writing an SQL SELECT statement inside of MS-Access yet?

此外,您应该指明如何连接到数据库,例如数据向导,数据适配器到OleDb的连接和命令。

Also you should indicate how you are connecting to the database e.g. data wizards, data adapter to OleDb connection and command.

由于我们没有收到回复,请允许我提出建议。将架构更改为

Since we've not heard back, let me make a suggestion. Change the schema to say

现在我们已经

所以现在无论你如何连接这样的SELECT(使用参数)都可以使用。

So now no matter how you connect a SELECT such as this (using a parameter) can be used.

SELECT FirstName, LastName
FROM Table1 INNER JOIN SchoolYears ON Table1.Id = SchoolYears.PersonId
WHERE SchoolYears.SchoolYear=?;

也许包括这个人主键

深思熟虑。


这篇关于MS Access VB.Net:如何在多列中搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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