用VB编程如何在ACCESS中查询用户名和密码

来源:百度知道 编辑:UC知道 时间:2024/06/02 22:32:44
越详细越好,最好是源代码

dim con as new adodb.connection,rs as new adodb.recordset
dim strSQL As string
con.connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ACCESS数据库路径;Persist Security Info=False"
con.open

strSQL=select * from userinfo where userName=' & text1.text & "' and password='" & text2.text & "'"

rs.open strSQL,con,3,3

if rs.eof then
msgbox "登陆信息错误",vbcritical,"提示"
end if

如果满意我的回答,请给我加分,谢谢