如何使用支票可用性 [英] How to use check availability

查看:92
本文介绍了如何使用支票可用性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想检查访问数据库中数据的可用性.它有名字和姓氏.我要检查两个名字.如果两者相同,则应显示味精警报.

你能帮助我吗?请尽快回复.

谢谢
问候,
Sangeetha

Hi,

I want to check the availability of the data in access database. It have first name and last name feilds. I want to check both name. If both are same then it should show the msg alert.

Can you help me? Please reply as soon as possible.

Thank you,
Regards,
Sangeetha

推荐答案

尝试此查询

try this query

select count(*) from table1 where fname = lname;


如果count大于1,则存在名字和姓氏相同的记录.


if count is more then 1 then record exists where first name and last name is same.

select fname, lname from table1 where fname = lname;



获取fname和lname


如果fname和lname是用户输入,则尝试此查询



To get the fname and lname


If fname and lname is user input then, try this query

select count(*) from table1 where fname = firstname name and lname = lastname;



如果count大于1,则记录存在名字和姓氏的地方.



if count is more then 1 then record exists where first name and last name is exists.


你好...

为了检查数据的可用性,您需要在插入该数据之前执行此步骤....

1)如果用户当时想首先插入数据,则需要触发选择查询...

2)首先,您需要触发这样的选择查询....

Hello...

For checking data avaibility you need to follow this step before you insert that data....

1) When user wants to insert data at that time first of all you need to fire a select query...

2) means first of all you need to fire select query like this....

SELECT * FROM TABLENAME WHERE FIRSTNAME = @FIRSTNAME AND LASTNAME = @LASTNAME



3)如果查询返回的任何数据意味着数据库中的名字和姓氏已经存在,并且如果存在,那么您可以向用户发送一条消息,告知该名字已经存在.

4)或查询不返回任何数据意味着在数据库中没有使用该名称存储的内容,因此您可以触发插入式查询来存储数据....



3) IF your query returns any data that means in your database that first name and last name are already exist and if it so, then you can give a message to user that that name already exist.

4) or your query does not return any data means that in your database nothing store with that name so you can fire your inset query for storeing data....


编写查询来检查在数据库表中.
该查询想要-select count(*) from table where firstname=@firstname and lastname=@lastname.
如果它返回一个计数,则说明您已经在数据库中存储了这些记录,并且可以显示警报.

如果您在实施过程中遇到某些特定部分的问题,请将其张贴在此处,然后有人会为您提供帮助.
Write a query that checks this in the database table.
The query would like - select count(*) from table where firstname=@firstname and lastname=@lastname.
If it return a count, you already have those records in the database and can show an alert.

If you face issues with specific parts during this implementation, then post them here and someone will help you.


这篇关于如何使用支票可用性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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