13-04-14, 03:39 PM
PHP كود :
'التحقق من عدم وجود قيمة
If txtUserName.Text = "" And txtPass.Text = "" Then
MessageBox.Show("فضلا ادخل اسم المستخدم وكلمة المرور", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return
End If
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.mdb")
Dim cmd As New OleDbCommand("select username,password from usres where username='" & txtUserName.Text & "'and password= '" & txtPass.Text & "'", con)
con.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader
If dr.Read Then
MessageBox.Show("تم الدخول بنجاح", "دخول", MessageBoxButtons.OK, MessageBoxIcon.Information)
con.Close()
Me.Hide()
Form2.ShowDialog()
Else
MessageBox.Show("اسم المستخدم او كلمة المرور خاطئة", "تنبيه", MessageBoxButtons.OK, MessageBoxIcon.Error)
con.Close()
Return
End If
هذا الكود صحيح ومجرب مع قواعد بيانات اكسس
![[صورة مرفقة: g5qidgW.jpg]](http://i.imgur.com/g5qidgW.jpg)
ســبحــانك الـلهم بـحمدك , الـلهم لا عــلم لـنا الى مــأ علــمتــنا , الـلهـم علــمنـا ما جــهلـنا وانــفـعنــا بــما عــلمــتنـا انــك انـتَ الـسـميع الــعلــيم الـحكـيم ~~!I!
