vb 用ado实现多用户登录

来源:百度知道 编辑:UC知道 时间:2024/04/28 23:25:45
对不起,各位大虾!
问题补充如下:
我之前是用data控件实现多用户登录的,因为data不能操作access2003,所以我想改用ado来实现,程序如上,但是当我程序运行时,即使我用user_list表中的用户名和密码登陆,程序还是提示我“账号或密码错误”,若用select * from user_list where ID='"&text1.text&"' and PWD='"&text2.text&"'"语句,结果用什么密码都可以登陆,5555~~~

昨晚失眠中,起步绕阶行,已三更

再送上10分&跪地感谢++

调试一下 你所给的 SQL语句并没有错误
给个例子你看看!!!
Private Sub Command1_Click()
dim rs as Recordset
Dim yonghu_id As String
Dim yonghu_mima As String
Dim aa As New Form2

set rs = New Recordset
yonghu_id = Trim(Text1.Text)
yonghu_mima = Text2.Text

str_sql="select * from yh where [yonghu_id]='" & yonghu_id & "' and [yonghu_mima]='" & yonghu_mima & "'"

rs.Open str_sql, Cn, adOpenStatic, adLockOptimistic, adCmdText
If rs.RecordCount <= 0 Then
MsgBox "登陆失败!", vbInformation
rs.Close
Exit Sub
Else
MsgBox "登陆成功!", vbInformation
dq = yonghu_id
End If
rs.Close
Unload Me
End Sub

'cn 为已建立好的连接

你点我的名字 在个人资料里有我的介绍 里面有我网盘的地址

你去vb里面找login.rar 那个就是登陆界面