rivate Sub Command1_Click()
Dim SQL As String
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs"
SQL = ""
[b]SQL = "select count(*) from tt where id='" & Trim(Text1.Text) & "' "
SQL = SQL & "and mima='" & Trim(Text2.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS(0) = 0 Then
MsgBox "您输入的帐号或密码有误"[/b]想知道上面这段代码的意思 谁解释一下啊!!!
Dim SQL As String
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs"
SQL = ""
[b]SQL = "select count(*) from tt where id='" & Trim(Text1.Text) & "' "
SQL = SQL & "and mima='" & Trim(Text2.Text) & "'"
Set adoRS = adoCon.Execute(SQL)
If adoRS(0) = 0 Then
MsgBox "您输入的帐号或密码有误"[/b]想知道上面这段代码的意思 谁解释一下啊!!!
你想知道什麼。
不過,很明顯,這又抄錯、又不完整。大體如private Sub Command1_Click()
Dim SQL As String
Set adoCon = New ADODB.Connection
'打開數據庫連接
adoCon.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs"
'準備查詢語句,本語句是返回符合條件的記錄數
SQL = "select count(*) from tt where id='" & Trim(Text1.Text) & "' "
SQL = SQL & "and mima='" & Trim(Text2.Text) & "'" '執行查詢,並返回結果集
Set adoRS = adoCon.Execute(SQL)
'判斷結果中的第一列是否等於0
If adoRS(0) = 0 Then
MsgBox "您输入的帐号或密码有误"
Exit Sub '退出本過程
end if '其它的處理end sub
SQL = "select count(*) from tt where id='" & Trim(Text1.Text) & "' "
SQL = SQL & "and mima='" & Trim(Text2.Text) & "'" '執行查詢,並返回結果集
Set adoRS = adoCon.Execute(SQL)想问 这几句下来 sql的变化 而且是什么意思
或者哪位可以帮我一下 我有一个数据表 里面存有帐号和密码 。做登入系统的界面 有帐号和密码的输入 。然后判断帐号密码是否相符 。
求求大家