If sle_1. Text="" or sle_2. Text=" "then
Messagebox (" error ", "user name or password cannot be empty!" , the exclamation! , ok!
The else
Select the user name, password
Into: usename, password
The from nbc1
Where nbc1. Username=: sle_1. Text;
If usename=sle_1. Text and password=sle_2. The text then
Open (w_main)
Close (w_login)
The else
Messagebox (" error ", "user name or password mistake, please input again", the exclamation! , ok!
End the if
End the if
Above for the login window code: under the pb comes with database ASA tests pass, but it cannot pass the SQL 2000 database, please expert help, thank you!
CodePudding user response:
Tracking once know!CodePudding user response:
Whether in different expressions on format, though, like access and VFP is SQL query but sometimes said statement is different,CodePudding user response:
Grammar should not be wrong, but is not achieve the effectCodePudding user response:
I tried it once, if the user name and password different ones can get through it,CodePudding user response:
I said, tracking the debugged!So you write a bit problems
String s_pw, s_un
Int I
S_pw=trim (sle_1. Text)
S_un=trim (sle_2. Text)
//text value shall be taken to the variable to use!
Select count (*) into: (I)
The from nbc1
Where the username=: s_un and password=: s_pw;
//column names in Chinese, the trouble!
If I=1 then
//success
The else
//not successful
End the if
CodePudding user response:
If is me, will be roughly as follows:string as_emp_id, as_emp_pass
Int I
As_emp_id=sle_1. Text
As_emp_pass=sle_2. Text
If len (as_emp_id)=0 or len (as_emp_pass)=0 then
Messagebox (" error ", "user name or password cannot be empty!" , the exclamation! , ok!
Return
End the if
Select 1 into: I
The from nbc1
Where the user name=: as_emp_id and
Password=: as_emp_pass;
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (" error ", "user name or password mistake, please input again", the exclamation! , ok!
Return
End the if
Open (w_main)
Close (w_login)
Of course this is only for your writing, my practice is in call log objects
CodePudding user response:
Agree with the upstairsCodePudding user response:
I also have a question outside, everybody's nickname are how to set??????? How do I not?? Where to set??? Thank you,,CodePudding user response:
Add a breakpoint debugCodePudding user response:
[Quote=refer to the original poster JTSZQZXZZH posts:]String password, usename
If sle_1. Text="" or sle_2. Text=" "then
Messagebox (" error ", "user name or password cannot be empty!" , the exclamation! , ok!
The else
Select the user name, password
Into: usename, password
The from nbc1
Where nbc1. Username=: sle_1. Text;
If usename=sle_1. Text and password=sle_2. The text then
Open (w_main)
Close (w_login)
The else
Messagebox (" error ", "user name or password mistake, please input again", the exclamation! , ok!
End the if
============================================================
"Messagebox (" error", "user name or password cannot be empty!" , the exclamation! , ok! "
Behind + 1 sentence: return
"If usename=sle_1. Text and password=sle_2. The text then"
The front +
If the sqlca. Sqlcode<> 0 then
Messagebox (" ", "could not find the data in the database!" )
Return
End the if
Other should pay attention to use the trim removes white Spaces at the both side, is no problem
Back to the eighth floor, said in my community - & gt; Personal information -> community said ok ~
CodePudding user response:
The