2013-12-16 177 views
0

即時新手,我想創建一個使用Windows Form登錄,我有2個文本框,用戶名和密碼和確定按鈕,我想要它連接到MS Access,那裏有很多賬戶,文件名是「Sunergeos Data.accdb」,你能幫我解決這個問題嗎?使用MS Access在VB 2008中創建日誌

+0

你想究竟 – SK2185

+0

@Senthilkumar日誌中,在那裏你會需要輸入用戶名和密碼,然後比較你在文本框中插入MS接入類型知道,如果輸入不正確的代碼。用戶名和密碼在MS ACCESS中 – EysAce

回答

0
Protected Sub btnLogIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogIn.Click 
Conn() 
Dim Chklog as Boolean 
Cmd = new SqlCommand("select count(*) from tblLogin where [email protected] and pass [email protected]",con) 
Cmd.Parameters .AddWithValue ("@Uname", txtUname.Text) 
Cmd.Parameters .AddWithValue ("@Pass", txtPass.Text) 
Chklog = Convert.ToBoolean(Cmd.ExcuteScalar()) 
If Chklog = True Then 
Response.Redirect("yourpage.aspx") 
Else 
'Do something 
End If 
End Sub