بتاريخ: 1 أغسطس 200817 سنة comment_134737 log on لنفرض أن لدينا مشروع وقمت بعمل واجهة له وهى عبارة عن مدخل لهذا المشروع شاشة user_name , user_no , password , ok , cancel وهى تتكون من ثلاثة تكست أيتم وزرينcancel فكتبت الكود التالى تحت الزر DO_KEY('exit_form(no_commit)'); ok وكتبت الكود التالى تحت الزر IF(:user_no IS NULL)THEN message('please insert your user number '); end if; IF(:user_name IS NULL)THEN message('please insert your user name '); end if; IF(:password IS NULL)THEN message('please insert your password '); end if; declare a varchar2(10); b varchar2(10); begin loop select user_name,password into a,b from users where user_no=:user_no; end loop ; if :user_no=:user_no then if(a=:user_name and b=:password) then message('Y have a bad password'); raise form_trigger_failure; else call_form('E:\fateh\main_window',hide,do_replace); end if; end if; end; فما الخطأ فى هذا الكود لكى عندما أدخل رقم المستخدم واسمه والباسورد وأضغط "أوكى" فاذا كانت هذا البيانات مخزنة فى قاعدة البيانات main_window فانها تقوم هذه الشاشة بادخالى مباشرة الى شاشة 'E:\fateh\main_window' والتى نفترض وجودها كما فى هذا المسارأرجو التوضيح وتصحيح الخطأ وجزاكم الله عنى كل خير [email protected] تقديم بلاغ
بتاريخ: 1 أغسطس 200817 سنة comment_134747 حـبـيـب قـلـبي ..في الـبـداية .. خل الكود منظمبحيث التعريفات تكون في الـDeclareوالعمليات بعد الـbegin .. وممكن تضيف Exception لو تريديعني أنقل الـ3 if statements لـ داخل الـBeginثانياً: شـو فـايـدة الـLoop ؟؟ والكود مالك ماله أي داعي بتاتاًثالثا: أنا أقترح عليك تعدل الكود إلى التالي ..جــرب ورد علي .. لأني مب متأكــد 100% declare a varchar2(10); b varchar2(10); begin IF(:user_no IS NULL)THEN message('please insert your user number '); end if; IF(:user_name IS NULL)THEN message('please insert your user name '); end if; IF(:password IS NULL)THEN message('please insert your password '); end if; select user_name,password into a,b from users where user_no=:user_no; if :user_no=:user_no then if(a=:user_name and b=:password) then call_form('E:\fateh\main_window',hide,do_replace); else message('Y have a bad password'); raise form_trigger_failure; end if; end if; end; تقديم بلاغ
بتاريخ: 2 أغسطس 200817 سنة comment_134758 تحتاج إلى ترقر عند ادخال رقم المستخدموترقر عندادخال كلمة المرور -- use this trigger ( vald_item user_no) begin if :user_no is not null then select user_name,password into :user_name,:global.password from users where user_no=:user_no; exception when others then raise form_trigger_failure; else message('please insert your user number '); :global.password:=null; raise form_trigger_failure; end if; end; ------------------------------------------------------------------- -- use this trigger ( vald_item password) begin if :password is not null and :global.password is not null and :global.password =:password then call_form('E:\fateh\main_window',hide,do_replace); -- dont use path else message('Y have a bad password'); end if; end; تقديم بلاغ
بتاريخ: 2 أغسطس 200817 سنة comment_134759 ملاحظة بعد مناداة الفورم أو قبلهأو عندما تكون شاشة الدخول نشيطة قم بالغاء كلمة المرور المحفوظة :global.password:=null;وبالنسبة للتريقر الخاص بكلمة المرور الصحيحKEY NEXT_ITEM تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.