Arsip: User Login pada status bar

 
user image
more 7 years ago

yanuar1087

saya mau tanya nih, pada form di delphiq, ingin q beri tambahan tampilan status bar, yang menampikan nama USER yang sesuai saat dia login ke aplikasi (.exe). Mohon bantuan mahadewa n mahadewi DELPHI....
user image
more 7 years ago

cartrun

@yanuar1087: saya mau tanya nih, pada form di delphiq, ingin q beri tambahan tampilan status bar, yang menampikan nama USER yang sesuai saat dia login ke aplikasi (.exe). Mohon bantuan mahadewa n mahadewi DELPHI....
printscreen dari program login.y di lampirkan gan biar tau kasus nya kaya gmn.' tpi buat test km bisa pakai ini (ini studi kasus pake database .sql). di button login km tulis. procedureTForm1.Button1Click(Sender: TObject); begin with FMenuUtama.ZQuery1 do begin SQL.Clear; SQL.Text:= 'Select From Login Where Username = '+QuotedStr(edit1.Text); Close; Open; end; if FMenuUtama.ZQuery1.RecordCount = 0 then begin Application.MessageBox('Maaf, username tersebut tidak ada!','Information',MB_OK OR MB_ICONINFORMATION); Edit1.SetFocus; end else if FMenuUtama.ZQuery1.FieldByName('Level').AsString <> Combobox1.Text then begin Application.MessageBox('Level yang anda masukan salah!','Information',MB_OK OR MB_ICONINFORMATION); Combobox1.SetFocus; end else if FMenuUtama.ZQuery1.FieldByName('Password').AsString <> Edit2.Text then begin Application.MessageBox('Password salah!','Error',MB_OK OR MB_ICONERROR); Edit2.SetFocus; end else begin FMenuUtama.StatusBar1.Panels[1].Text:= Edit1.Text; FMenuUtama.StatusBar1.Panels[2].Text:= Combobox1.Text; FLogin.Hide; FMenuUtama.Show; end; end;
user image
more 7 years ago

yanuar1087

Ini Koding di delphi2010 gan. untuk koding status bar dari agan, taci q coba eror gan... procedure TForm1.Button1Click(Sender: TObject); ---Button Login begin with MyQuery1 do begin MyQuery1.Close; MyQuery1.SQL.Clear; MyQuery1.SQL.Text:='select * from petugas where username ='+QuotedStr(Edit1.Text); MyQuery1.Open; end; if MyQuery1.RecordCount = 0 then Application.MessageBox('Maaf, username tersebut tidak ada', 'Informasi', MB_OK or MB_ICONINFORMATION) else begin if MyQuery1.FieldByName('password').AsString <> Edit2.Text then begin Application.MessageBox('Pastikan username atau password benar', 'Error', MB_OK or MB_ICONERROR) ; end else begin hide; Form2.Show; end; end; end; procedure TForm1.Button2Click(Sender: TObject); begin if (Application.MessageBox('Yakin ingin keluar dari aplikasi??' ,'pertanyaan',mb_iconquestion or mb_yesno) = idyes) then Application.Terminate; end; Mohon bantuanx tuk para mahadewa n mahadewi Delphi... saya masih newbie dlm delphi ini.. sbeleumx terima kasih atas bantuanya.
user image
more 7 years ago

yanuar1087

tuk script lengkapx ini gan: unit login; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, MemDS, DBAccess, MyAccess, StdCtrls, jpeg, ExtCtrls; type TForm1 = class(TForm) Image1: TImage; Edit1: TEdit; Edit2: TEdit; Button1: TButton; Button2: TButton; DataSource1: TDataSource; MyConnection1: TMyConnection; MyQuery1: TMyQuery; Label1: TLabel; Label2: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses menu; {$R .dfm} procedure TForm1.Button1Click(Sender: TObject); begin with MyQuery1 do begin MyQuery1.Close; MyQuery1.SQL.Clear; MyQuery1.SQL.Text:='select from petugas where username ='+QuotedStr(Edit1.Text); MyQuery1.Open; end; if MyQuery1.RecordCount = 0 then Application.MessageBox('Maaf, username tersebut tidak ada', 'Informasi', MB_OK or MB_ICONINFORMATION) else begin if MyQuery1.FieldByName('password').AsString <> Edit2.Text then begin Application.MessageBox('Pastikan username atau password benar', 'Error', MB_OK or MB_ICONERROR) ; end else begin hide; Form2.Show; end; end; end; procedure TForm1.Button2Click(Sender: TObject); begin if (Application.MessageBox('Yakin ingin keluar dari aplikasi??' ,'pertanyaan',mb_iconquestion or mb_yesno) = idyes) then Application.Terminate; end; end.
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com