Home > database >  Ash way permissions management issues
Ash way permissions management issues

Time:09-26

I write directly in the main window open:

Select emp, pay2, title into: iv_emp, lv_pay2, : lv_title//instance variable
The from popedom
Where id=: g_uno;//global variable

If iv_emp='0' and lv_pay2='0' and lv_title='0' then
Messagebox (' prompt ', 'please set the permissions to enter')
The halt close
End the if

If iv_emp='1' then
M_main. M_ student management. M_. Enabled=true
The else
M_main. M_ student management. M_. Enabled=false
End the if

If lv_pay2='1' then
Delete m_main. M_ student management. M_. Enabled=true
The else
Delete m_main. M_ student management. M_. Enabled=false
End the if

If lv_title='1' then
M_main. M_ student management. M_. Enabled=true
The else
M_main. M_ student management. M_. Enabled=false
End the if

Results in account inside, no matter I emp in SQL, pay2, title three values 0 or 1, the increase of the system in the left menu, delete, modify is grey, solving

CodePudding user response:

Debug tracking it
Conclusion according to the result of your code and execution: iv_emp, lv_pay2, lv_title impossible to '0' at the same time, but the result is at the same time as the gray, that is likely the code here is not to the main menu,
You put a button directly, write in the clicked event: m_main. M_ student management. M_ deleted. Enabled=true try, look have the effect

CodePudding user response:

Can be friends after the select statement to write:
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (' SQL execution error, the sqlca sqlerrtext)
Return
End the if

See if the SQL execution is successful,

CodePudding user response:

Your iv_emp lv_pay2, lv_title value may be null!
  • Related