Click to See Complete Forum and Search --> : VB and Access
ggilmour
12-30-2001, 12:20 PM
I'm new at this, so I apologise if the answer is blindingly obvious.
I have a VB Form with a username text box, password text box and an OK button, Linked to an Access table with a username and password field.
When the user clicks the OK button on my VB form, I want the Access table to search for a record which matches the username and password entered on the form.
Thanks,
George
qball
12-30-2001, 08:46 PM
VB Form... Linked to an Access table with a username and password field.
Not sure what the above implies, so my answer may not be applicable.
Anyway, normally the procedure would be as follows:
Form with 2 textboxes, one password, so user types and sees "***...", Cancel button, Ok button that becomes enabled when user has entered something in each (simple validation).
Script/function/event on Clicked on OK button that takes name/pword combo and basically performs this SQL statement:
SELECT
user_id //whatever
FROM
users
WHERE
name = "user input name" AND
password = "user input pword";
Iffin get an user_id, let 'em in, else bad user.
Now, iffin mechanism, for above, with 'linking' to table in VB, then you'll need to set the link to the proper table columns and so forth...but I don't think so...
ggilmour
12-31-2001, 07:33 AM
it worked, thanks. Come to think of it, all I needed was to know the SQL statement.
qball
01-02-2002, 08:42 PM
you're welcome.
SQL is a good thing...
SysOpt.com
Copyright Internet.com Inc. All Rights Reserved.