Home > database >  Pb landing window problem! Consult ace nasty!!!!!!!!!!
Pb landing window problem! Consult ace nasty!!!!!!!!!!

Time:10-05

Younger brother just learning PB to do a landing window, use the SQL 2000 database, also have the user table, but how do you write "login" button code?

CodePudding user response:

Is not you want according to the user to enter the account number, password to the user query matching data in the table?
Write an SQL query, you can.

CodePudding user response:

This is the most simple!
Read more!

CodePudding user response:

/*==================================*/
//checklogin () check on local function
//
//
/*==================================*/
//landing control
String ls_logincd ls_pwd, ls_curusername
The integer li_type
Ls_logincd=sle_logincd. Text
Ls_pwd=sle_pwd. Text
Li_type=checklogin (ls_logincd ls_pwd)

If li_type=0 then
//landing successful initialization information, dealing with the global variable
GLOBAL_LoginCD=ls_logincd
GLOBAL_UserCD=ls_usercd
GLOBAL_UserLoginTime=gf_getnowdatetime ()
Select the username into: ls_curusername from pub_users where usercd=: GLOBAL_UserCD;
GLOBAL_LoginUserName=ls_curusername
Loginsuc ()
The else
If li_type=3 then
Sle_logincd. Text='
Sle_pwd. Text='
Sle_logincd. Setfocus ()
Elseif li_type=4 then
Sle_logincd. Text='
Sle_pwd. Text='
Sle_logincd. SetFocus ()
Elseif li_type=2 then
Sle_pwd. SetFocus ()
End the if
Messagebox (' tip 'gf_checkdata (li_type))
End the if

Look at it! A lot of method!

CodePudding user response:

After open the generated EXE files, can enter the beginning of the window, the window function is the user login, but enter the user name and password, click ok,
Start window OPEN event:
Ds_users=create datastore
Ds_users. Dataobject="dw_userinfo"
Ds_users. Settransobject (SQLCA)
Ds_users. Retrieve ()
Userid. Text=""
Password. The text=""
Userid. Setfocus ()


This is to determine the button under the program
String t1="operating hints"
String t2="login failed"
String m1="please enter the user name! And then try again... "
String m2="please enter the password! And then try again... "
String m3="username or password is not correct! Please try again... "

If userid. Text="" then
Messagebox (t1, m1)
Return
End the if
If the password. The text="" then
Messagebox (t1, m2)
Password. Setfocus ()
Return
End the if

Int the rowcount=0
Select count (*) into: rowcount
The from usersinfo
Where usersname=: userid. Text and passwd=: password. Text
;
If rowcount> 0 then
Char temp
The select rank into: temp
The from usersinfo
Where usersname=: userid. Text and passwd=: password. The text;
UserRank=temp
Gs_userid=userid. Text
Gs_pwd=password. Text
The else
Messagebox (t2, m3, the Exclamation!
Return
End the if

The parent. The visible=false
Open (w_main)
Close (the parent)

CodePudding user response:

Reading is the absolute principle

CodePudding user response:

Forward
Global type w_login from w_anc_xe
End type
Type st_3 from statictext within w_login
End type
Type phl_1 from picturehyperlink within w_login
End type
Type sle_kl from singlelineedit within w_login
End type
Type cb_ok from commandbutton within w_login
End type
Type cb_cancel from commandbutton within w_login
End type
Type sle_2 from singlelineedit within w_login
End type
Type st_1 from statictext within w_login
End type
Type st_2 from statictext within w_login
End type
Type sle_yhm from singlelineedit within w_login
End type
Type gb_1 from groupbox within w_login
End type
End forward

Global type w_login from w_anc_xe
The integer width=1792
The integer height=1048
String title="system login"
Boolean controlmenu=true
Windowtype windowtype=response!
Long backcolor=67108864
String icon="Application5!"
Boolean center=true
St_3 st_3
Phl_1 phl_1
Sle_kl sle_kl
Cb_ok cb_ok
Cb_cancel cb_cancel
Sle_2 sle_2
St_1 st_1
St_2 st_2
Sle_yhm sle_yhm
Gb_1 gb_1
End type
Global w_login w_login

The type variables
String is_get
The integer ii_ret
End the variables

Forward as
Public subroutine wf_window_center (window aw_window)
End as

On w_login. The create
Int iCurrent
Call super: : create
Enclosing st_3=create st_3
Enclosing phl_1=create phl_1
Enclosing sle_kl=create sle_kl
Enclosing cb_ok=create cb_ok
Enclosing cb_cancel=create cb_cancel
Enclosing sle_2=create sle_2
Enclosing st_1=create st_1
Enclosing st_2=create st_2
Enclosing sle_yhm=create sle_yhm
Enclosing gb_1=create gb_1
ICurrent=UpperBound (enclosing Control)
This. The Control [iCurrent + 1]=this. St_3
This. The Control [iCurrent + 2]=this. Phl_1
This. The Control [iCurrent + 3]=this. Sle_kl
This. The Control [iCurrent + 4]=this. Cb_ok
This. The Control/iCurrent + 5=this. Cb_cancel
This. The Control/iCurrent + 6=this. Sle_2
This. The Control [iCurrent + 7)=this. St_1
This. The Control [iCurrent + 8]=this. St_2
This. The Control [iCurrent + 9]=this. Sle_yhm
This. The Control/iCurrent + 10=this. Gb_1
End on

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related