我如何从访问中检索数据 [英] how can i retrive data from access

查看:88
本文介绍了我如何从访问中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了1个登录表单..
我想检查输入的id n密码是否与存储在数据库ms access中的id n密码匹配?
如果是,则vll显示下一个表单,否则将打印msg框
所以我的问题是如何从后端匹配id n密码?

i had created 1 log in form..
i want to check that is the entered id n password is match with the id n password which stored in data base ms access
if it is then it vll show the next form else it print msg box
so my que is how to match the id n password from back end?

推荐答案

您需要使用类似这样的查询来检查是否找到了匹配项:
我假设您了解连接到Db并使用ADO.Net的基础知识.

You need to use a query something like this to check if any match is found or not:
I assume you know basics of connecting to Db and using ADO.Net.

SELECT COUNT (*) FROM [signin] WHERE username=''" + txtusername.Text + "'' AND password=''" + txtpassword.Text + "''")



有一则与您要寻找的类似的帖子,在这里是:
http://www.codeproject.com/Answers/129712/Login-check-database-if-user-exists.aspx#answer1 [



There was a post similar to what you are looking for, here it is:
http://www.codeproject.com/Answers/129712/Login-check-database-if-user-exists.aspx#answer1[^]


另一种常用的基本连接方法是OBDC.
The other basic connection method commonly used is OBDC.


这篇关于我如何从访问中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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