你可以debug將sql語句截出來放到數(shù)據(jù)里運行一下試試sql語句有沒有問題

我們提供的服務(wù)有:成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、外貿(mào)營銷網(wǎng)站建設(shè)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、隆安ssl等。為近千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的隆安網(wǎng)站制作公司
再有將ds1.Tables.Item(0)改為ds.Tables[0]試試
以下這里有錯誤:
Dim mysqlstr As String = "SELECT * FROM 登錄表 WHERE users='" username " 'AND password='" userpassword " '"
修改為:
Dim mysqlstr As String = "SELECT * FROM 登錄表 WHERE users='" username "' AND password='" userpassword "'"
Private?Sub?BtOk_Click(ByVal?sender?As?Object,?ByVal?e?As?System.EventArgs)?Handles?Btok.Click
Dim?con?As?OleDbConnection?=?New?OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data?Source=Admin.accdb;Persist?Security?Info=True")
Dim?com?As?OleDbCommand?=?New?OleDbCommand("select?*?from?用戶名",?con)
con.Open()
Dim?h1?As?OleDbDataReader
Dim?table?As?New?DataTable
h1?=?com.ExecuteReader()
table.Load(h1)
If?txtName.Text?=?""?Then
MsgBox("請輸入用戶名",?MsgBoxStyle.OkCancel?+?MsgBoxStyle.Exclamation,?"錯誤提示")
ElseIf?txtName.Text??""?And?txtPasswd.Text?=?""?Then
MsgBox("請輸入密碼",?MsgBoxStyle.OkCancel?+?MsgBoxStyle.Exclamation,?"錯誤提示")
ElseIf?table.Select("用戶名='"??txtName.Text??"'").Length??0?Then
If?table.Select("用戶名='"??txtName.Text??"'")(0)("密碼").ToString?=?txtPasswd.Text?Then
MsgBox("成功登陸",?MsgBoxStyle.OkCancel?+?MsgBoxStyle.Exclamation,?"錯誤提示")?Then
Form1.Show()
Me.Visible?=?False
Exit?Sub
Else
MsgBox("密碼錯誤",?MsgBoxStyle.OkCancel?+?MsgBoxStyle.Exclamation,?"錯誤提示")
End?If
Else
MsgBox("用戶名不存在",?MsgBoxStyle.OkCancel?+?MsgBoxStyle.Exclamation,?"錯誤提示")
Exit?Sub
End?If
table.Clear()
h1.Close()
con.Close()
End?Sub
網(wǎng)頁題目:vb.net賬號密碼,vb輸入密碼
路徑分享:http://chinadenli.net/article49/dseoghh.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、外貿(mào)網(wǎng)站建設(shè)、服務(wù)器托管、搜索引擎優(yōu)化、動態(tài)網(wǎng)站、ChatGPT
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)