老生常谈的问题了依旧是vb91错误麻烦大家帮我看看是哪里的问题

[复制链接]
查看11 | 回复2 | 2021-1-27 05:09:39 | 显示全部楼层 |阅读模式
我们用的是adodc插件,mysql数据库
代码如下:
PrivateSubCommand1_Click()
Adodc1.RecordSource="select*from'学生用户信息表'"
Adodc2.RecordSource="select*from'管理员信息表'"
DimaAsSingle
a=0
IfOption2.Value=TrueThen'用户系统
IfOption1.Value=FalseAndOption2.Value=FalseThen
MsgBox"请选择您的身份"'确保身份不为空
EndIf
IfText1.Text=""Then
MsgBox"用户名不能为空,请重新输入"'保证用户名和密码不为空
EndIf
DoUntilAdodc1.Recordset.EOF
IfText1.Text=Adodc1.Recordset.Fields("studentid")AndText2.Text=Adodc1.Recordset.Fields("passeord")Then
登录界面.Hide
订阅界面.Show
ExitDo
a=a+1
EndIf
Loop
Ifa=Adodc1.Recordset.RecordCountThen
MsgBox"您的账号或密码输入错误"
EndIf
Else
IfOption1.Value=FalseAndOption2.Value=FalseThen
MsgBox"请选择您的身份"'确保身份不为空
EndIf
IfText1.Text=""Then
MsgBox"用户名不能为空,请重新输入"'保证用户名和密码不为空
Text1.SetFocus'光标返回
EndIf
DoUntilAdodc1.Recordset.EOF
IfText1.Text=Adodc1.Recordset.Fields("managerid")AndText2.Text=Adodc1.Recordset.Fields("passeord")Then
登录界面.Hide
管理员界面.Show
ExitDo
a=a+1
EndIf
Loop
Ifa=Adodc2.Recordset.RecordCountThen
MsgBox"您的账号或密码输入错误"
EndIf
EndIf

EndSub
分 -->
回复

使用道具 举报

千问 | 2021-1-27 05:09:39 | 显示全部楼层
连接mysql数据库的话需要安装mysql驱动
回复

使用道具 举报

千问 | 2021-1-27 05:09:39 | 显示全部楼层
With块变量没有设置(错误91)
看看是不是有对象为Nothing
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行