Imports System.Data.OleDb
Public Class ex1_LoginForm
Dim sql As String
Private Sub loginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
con.ConnectionString = "Provider=Microsoft.ace.OLEDB.12.0;Data Source = airline.accdb"
con.Open()
End Sub
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim name As String
Dim totalmile As Long
sql = "select * from customer where firstname = '"
sql &= txtUsername.Text + "' and pass_id = '"
sql &= txtPassword.Text + "'"
mycommand = New OleDbCommand(sql, con)
drcustomer = mycommand.ExecuteReader**********************มันติดครงนี้พอจะมีวิธีไดบ้างที่จะรันบน window7 64bit ได้
If drcustomer.HasRows Then
drcustomer.Read()
name = drcustomer("firstname")
totalmile = drcustomer("totalmile")
MsgBox("hello " & name & " your total mile " & totalmile, MsgBoxStyle.OkOnly, "Check Mile")
If (totalmile > 10000) Then
MsgBox("Your are grade A customer", MsgBoxStyle.OkOnly, "Text for VIP")
Else
MsgBox("Your are grade B customer", MsgBoxStyle.OkOnly, "Text for Cus")
End If