VB做的一个系统的登陆界面连数据库的一个表
3个回答
2013-09-26
展开全部
Dim rs As New ADODB.Recordset
Dim Conn As ADODB.Connection
Dim ConnectionString As String
Dim sql As String
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "用散雹兆户名,密码 不能为空"
Else
Set Conn = CreateObject("ADODB.Connection")
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\love.mdb;Persist Security Info=False;"
Conn.Open ConnectionString
sql = "select * from denglu where 用户名='" & Text1.Text & "' and 密码='" & Text2.Text & "'"
rs.Open sql, Conn, 3, 3
If Not rs.EOF Then
Form2.Show'跳到转向肆游的页面
Else
MsgBox "冲租用户名或密码错误,请重新输入"
End If
Dim Conn As ADODB.Connection
Dim ConnectionString As String
Dim sql As String
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "用散雹兆户名,密码 不能为空"
Else
Set Conn = CreateObject("ADODB.Connection")
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\love.mdb;Persist Security Info=False;"
Conn.Open ConnectionString
sql = "select * from denglu where 用户名='" & Text1.Text & "' and 密码='" & Text2.Text & "'"
rs.Open sql, Conn, 3, 3
If Not rs.EOF Then
Form2.Show'跳到转向肆游的页面
Else
MsgBox "冲租用户名或密码错误,请重新输入"
End If
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-09-26
展开全部
str="select * from user where txtuser='滚启"首备瞎 & txtuser.text & "' and txtpass='" & txtpassward & "者空'"
recordset.open str,conn,1,1
if recordset.RecordCount>0 then
load yourform
else
msgbox
endif
recordset.open str,conn,1,1
if recordset.RecordCount>0 then
load yourform
else
msgbox
endif
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-09-26
展开全部
用DATA控件,然后查询数据集就行了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询