rstFindFirst需要急需! [英] rstFindFirst Help Needed Urgently!

查看:57
本文介绍了rstFindFirst需要急需!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是Access的新手,或者事实上这是我第一次使用数据库。我正在为一个类项目的Access工作,我在使用登录应用程序时遇到了一些麻烦。该程序基本上是一个小型商店的数据库,允许员工在有或没有管理员访问权限的情况下登录。每个员工的用户名和密码存储在strUseName和strPassword下的tblEmployee中。该表还包含ysnAdmin复选框。 (ysnAdmin布尔变量是全局声明的,因为它也是从frmMain调用的。)我遇到的问题是,当我尝试执行rst.FindFirst时,如果我输入的密码和用户名不正确并且记录是找不到但是当我输入存储在tblEmployee中的密码和用户名时,我收到一条Type错误消息。如果有人能看到这段代码并告诉我我做错了什么,我真的很感激。

Hi,

I''m new to Access or as a matter of fact it''s the first time that I''m working with a database. I''m working on a program in Access for a class project and I''m having some trouble with the login application. The program is basically a database for a small store which allows the employees to login with or without administrator access. The usename and password for each employee is stored in tblEmployee under strUseName and strPassword. The table also contains a ysnAdmin checkbox. (The ysnAdmin boolean variable is declared globally since it is also called from frmMain.)The problem I''m having is that when I try to do the rst.FindFirst it works if the password and username I enter are incorrect and the record is not found but when I enter a password and username that is stored in the tblEmployee I get a Type error message. I would really appreciate if somebody could look at this code and tell me what I''m doing wrong.

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

推荐答案

我们不应该在这里做任何人的功课,但是这里是你代码中不好的部分的修复。

We''re not supposed to be doing anybody''s homework here, but here''s a fix for the bad part of your code.

展开 | 选择 | Wrap | 行号


谢谢wvmitchel!我知道我仍然需要改进很多东西,但至少那些长期困扰我的部分现在可以通过你的帮助了解:)。
Thanks so much wvmitchel! I know that I still need to improve a lot of things but at least the part that has been bugging me for a long time works now thanks to your help :).






我是Access的新手,或者事实上这是我第一次使用数据库。我正在为一个类项目的Access工作,我在使用登录应用程序时遇到了一些麻烦。该程序基本上是一个小型商店的数据库,允许员工在有或没有管理员访问权限的情况下登录。每个员工的用户名和密码存储在strUseName和strPassword下的tblEmployee中。该表还包含ysnAdmin复选框。 (ysnAdmin布尔变量是全局声明的,因为它也是从frmMain调用的。)我遇到的问题是,当我尝试执行rst.FindFirst时,如果我输入的密码和用户名不正确并且记录是找不到但是当我输入存储在tblEmployee中的密码和用户名时,我收到一条Type错误消息。如果有人能看到这段代码并告诉我我做错了什么,我真的很感激。

Hi,

I''m new to Access or as a matter of fact it''s the first time that I''m working with a database. I''m working on a program in Access for a class project and I''m having some trouble with the login application. The program is basically a database for a small store which allows the employees to login with or without administrator access. The usename and password for each employee is stored in tblEmployee under strUseName and strPassword. The table also contains a ysnAdmin checkbox. (The ysnAdmin boolean variable is declared globally since it is also called from frmMain.)The problem I''m having is that when I try to do the rst.FindFirst it works if the password and username I enter are incorrect and the record is not found but when I enter a password and username that is stored in the tblEmployee I get a Type error message. I would really appreciate if somebody could look at this code and tell me what I''m doing wrong.

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号


这篇关于rstFindFirst需要急需!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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