String Ls.docx

  • Uploaded by: haryo
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View String Ls.docx as PDF for free.

More details

  • Words: 225
  • Pages: 2
String ls_password Integer li_status

// check null atau string kosong pada sle_nama dan sle_password IF IsNull(sle_nama.Text) OR Trim(sle_nama.Text, True) = "" THEN MessageBox("Login", "Masukkan Nama User anda.", Exclamation!) sle_nama.SetFocus() Return ELSEIF IsNull(sle_password.Text) OR Trim(sle_password.Text, True) = "" THEN MessageBox("Login", "Masukkan password anda.", Exclamation!) sle_password.SetFocus() Return END IF // set variabel gs_nama_user berdasarkan teks dalam sle_nama gs_nama_user = sle_nama.Text // cek data dalam database berdasarkan nama user yang dimasukkan di sle_nama SELECT user_id, user_password, user_full_name, user_level, user_status INTO :gl_user_id, :ls_password, :gs_nama_lengkap, :gi_level, :li_status FROM karyawan.tbl_user WHERE user_name = :gs_nama_user USING SQLCA; // nama user yang dimasukkan tidak ada dalam database IF SQLCA.SQLDBCode = 100 THEN MessageBox("Login", "Nama User tidak ada dalam database.", Exclamation!) sle_nama.SetFocus() Return END IF

// Database error IF SQLCA.SQLDBCode <> 0 THEN MessageBox("Error", "Database error, coba lagi atau hubungi administrator.", StopSign!) Return END IF // data ada dan database tidak error // cek password yang dimasukkan dalam sle_password // password tidak sama dengan database IF UPPER(ls_password) <> sle_password.Text THEN MessageBox("Login", "Password yang anda masukkan salah.", Exclamation!) sle_password.SetFocus() Return END IF // password sesuai dengan database, sekarang cek status user, 1 = Aktif, selain 1 maka dianggap tidak aktif // status user bukan 1 atau tidak aktif IF li_status <> 1 THEN MessageBox("Login", "Status user sudah tidak aktif, hubungi administrator.", Exclamation!) sle_nama.SetFocus() Return END IF // semua data ok ii_ret = 1 CloseWithReturn(Parent, ii_ret)

Related Documents

String
June 2020 26
String Library
October 2019 19
String Instructions
June 2020 6
String Theory
June 2020 10
String Function
May 2020 9
String Functions
May 2020 13

More Documents from ""