How to achieve? Experts invited! ! !

Category: Delphi -> Windows SDK/API Author: sz279992525 Date: 2012-09-17 14:40:46
 
sz279992525
2012-09-17 14:40:46
I wrote a program before the program starts with a login window, only the password is correct, the main window to appear
I am now with the login window and the main window appears, although it can achieve functional, but as said earlier, so how to do it?
vrzwj
2012-09-17 15:00:34
1 in the application, in the show before the main window, call the login window showmodal;
2 showmodal in determining the return value, if it is entered correctly, then continue; otherwise the user presses cancel such withdrawal or enter the wrong password, then exit the program
douoyeye
2012-09-17 15:04:32
login window you will be able to set up the main window!
yanshen2
2012-09-17 15:10:02
procedure Tpassform.BitBtn1Click (Sender: TObject);
label aa, bb;
var
strsql: string;
begin
strsql: = 'select * from users where (user = "' + combobox1.Text + '")';
dmq1.DateSQLFirst (strsql, query1);
if query1.Fields [1]. isnull then
begin
if edit1.Text <>'' then
begin
showmessage ('password is incorrect, please re-enter or contact with the administrator.');
goto bb;
end
; else
goto aa;
end
else
begin
; if edit1.Text <> query1.FieldValues ​​['password'] then
begin
showmessage ('password is incorrect, please re-enter or administrator. ');
goto bb;
; end
else
; goto aa;
end;
; aa: flag1: = true; names: = combobox1.text; close;
bb: edit1.SetFocus; edit1.Text: ='';

end;
fwx496531434
2012-09-17 15:18:08
OnActiver event of the main form to write your login code on the display window the