vb参数不足,期待是1
PrivateSubCommand1_Click()DimresultAsIntegerData1.RecordSource="select*from用户信息表where...
Private Sub Command1_Click()
Dim result As Integer
Data1.RecordSource = "select * from 用户信息表 where 用户名 like text1 "
Data1.Refresh
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "用户名、密码不能为空,请请输入用户名和密码!", vbOKOnly, "信息提示"
End If
If Text1.Text = "" And Text2.Text <> "" Then
MsgBox "用户名不能为空,请请输入用户名!", vbOKOnly, "信息提示"
End If
If Text1.Text <> "" And Text2.Text = "" Then
MsgBox "用密码不能为空,请请输入用户密码!", vbOKOnly, "信息提示"
End If
If Data1.Recordset.RecordCount = 0 Then
result = MsgBox("您所输入的用户名不存在,是否继续?", vbQuestion And vbOKCancel, "信息提示")
If result = 1 Then
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Unload Me
End
End If
Else
If Text1.Text = Text4.Text And Text2.Text = Text3.Text Then
Form3.Show
Form2.Hide
Else
MsgBox "密码错误,请重新输入!", vbInformation And vbOKOnly, "信息提示"
Text2.Text = ""
Text2.SetFocus
End If
End If
这是一个图书借阅系统的登陆界面,我是个vb菜鸟,高手帮忙指点一下,马上就要交了,555.。。 展开
Dim result As Integer
Data1.RecordSource = "select * from 用户信息表 where 用户名 like text1 "
Data1.Refresh
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "用户名、密码不能为空,请请输入用户名和密码!", vbOKOnly, "信息提示"
End If
If Text1.Text = "" And Text2.Text <> "" Then
MsgBox "用户名不能为空,请请输入用户名!", vbOKOnly, "信息提示"
End If
If Text1.Text <> "" And Text2.Text = "" Then
MsgBox "用密码不能为空,请请输入用户密码!", vbOKOnly, "信息提示"
End If
If Data1.Recordset.RecordCount = 0 Then
result = MsgBox("您所输入的用户名不存在,是否继续?", vbQuestion And vbOKCancel, "信息提示")
If result = 1 Then
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Unload Me
End
End If
Else
If Text1.Text = Text4.Text And Text2.Text = Text3.Text Then
Form3.Show
Form2.Hide
Else
MsgBox "密码错误,请重新输入!", vbInformation And vbOKOnly, "信息提示"
Text2.Text = ""
Text2.SetFocus
End If
End If
这是一个图书借阅系统的登陆界面,我是个vb菜鸟,高手帮忙指点一下,马上就要交了,555.。。 展开
2个回答
展开全部
Private Sub Command1_Click()
Dim result As Integer
Data1.RecordSource = "select * from 用户信息表 where 用户名 like '" + Text1.Text + "' "
Data1.Refresh
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "用户名、密码不能为空,请请输入用户名和密码!", vbOKOnly, "信息提示"
End If
If Text1.Text = "" And Text2.Text <> "" Then
MsgBox "用户名不能为空,请请输入用户名!", vbOKOnly, "信息提示"
End If
If Text1.Text <> "" And Text2.Text = "" Then
MsgBox "用密码不能为空,请请输入用户密码!", vbOKOnly, "信息提示"
End If
If Data1.Recordset.RecordCount = 0 Then
result = MsgBox("您所输入的用户名不存在,是否继续?", vbQuestion And vbOKCancel, "信息提示")
If result = 1 Then
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Unload Me
End If
Else
If Text1.Text = Text4.Text And Text2.Text = Text3.Text Then
Form3.Show
Form2.Hide
Else
MsgBox "密码错误,请重新输入!", vbInformation And vbOKOnly, "信息提示"
Text2.Text = ""
Text2.SetFocus
End If
End If
End Sub
Dim result As Integer
Data1.RecordSource = "select * from 用户信息表 where 用户名 like '" + Text1.Text + "' "
Data1.Refresh
If Text1.Text = "" And Text2.Text = "" Then
MsgBox "用户名、密码不能为空,请请输入用户名和密码!", vbOKOnly, "信息提示"
End If
If Text1.Text = "" And Text2.Text <> "" Then
MsgBox "用户名不能为空,请请输入用户名!", vbOKOnly, "信息提示"
End If
If Text1.Text <> "" And Text2.Text = "" Then
MsgBox "用密码不能为空,请请输入用户密码!", vbOKOnly, "信息提示"
End If
If Data1.Recordset.RecordCount = 0 Then
result = MsgBox("您所输入的用户名不存在,是否继续?", vbQuestion And vbOKCancel, "信息提示")
If result = 1 Then
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Else
Unload Me
End If
Else
If Text1.Text = Text4.Text And Text2.Text = Text3.Text Then
Form3.Show
Form2.Hide
Else
MsgBox "密码错误,请重新输入!", vbInformation And vbOKOnly, "信息提示"
Text2.Text = ""
Text2.SetFocus
End If
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
问题出在这里
Data1.RecordSource = "select * from 用户信息表 where 用户名 like text1 "
1、你应该先校验界面的输入,再写这个RecordSource
2、SQL语句应该是:
Data1.RecordSource = "select * from 用户信息表 where 用户名 like '"+text1.text +"' "
Data1.RecordSource = "select * from 用户信息表 where 用户名 like text1 "
1、你应该先校验界面的输入,再写这个RecordSource
2、SQL语句应该是:
Data1.RecordSource = "select * from 用户信息表 where 用户名 like '"+text1.text +"' "
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询