01.
Dim
sb
As
String
02.
sb =
"SELECT file_no from tb_use where user_dept = '"
& departmentIDA &
"' ;"
03.
Dim
sql
As
String
= sb.ToString()
04.
Dim
com
As
New
OleDbCommand()
05.
Dim
dr
As
OleDbDataReader
06.
07.
With
com
08.
.CommandType = CommandType.Text
09.
.CommandText = sql
10.
.Connection = Conn
11.
dr = .ExecuteReader()
12.
End
With
13.
If
dr.HasRows
Then
14.
dt =
New
DataTable()
15.
dt.Load(dr)
16.
Else
17.
dt =
New
DataTable()
18.
End
If
19.
20.
21.
Conn.Close()
22.
If
txtuser.Text = UserIDA
And
txtpassword.Text = PassIDA
Then
23.
Form2.Show()
24.
txtuser.Text =
""
25.
txtpassword.Text =
""
26.
Me
.Hide()
27.
Else
28.
MessageBox.Show(
"กรุณาใส่ข้อมูลให้ถูกต้อง"
,
Me
.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning)
29.
End
If