| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付买域名,送MP3、MP4
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY买空间,免费送域名(厦门中资源)
共有 555 人关注过本帖
标题:登陆界面
收藏  订阅  推荐  打印 
wilsonfu007
Rank: 1
等级:新手上路
帖子:10
积分:212
注册:2008-8-22
登陆界面

Private Sub Command1_Click()
Dim xg As String
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
xg = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "\xsgl.mdb"
cn.Open xg
rs.Open "select * from dl", cn, adOpenKeyset, adLockPessimistic
If rs.RecordCount > 0 Then
  If Text1.Text = "" Then
   MsgBox "请输入用户名", vbOKOnly + vbCritical, "登陆错误"
   Text1.SetFocus
   Exit Sub
  End If
     If Text1.Text <> "" Then
      Set rs1 = New ADODB.Recordset
          rs1.Open "select * from dl where user_id='" & Text1.Text & "'", cn, adOpenKeyset, adLockPessimistic
      Text2.SetFocus
     If rs1.RecordCount > 0 Then
       If Text2.Text <> "" Then
        rs1.Open "select * from dl where user_power='" & Text2.Text & "'", cn
        Command1.SetFocus
         If rs1.Fields("user_id") = Text1.Text And rs1.Fields("user_power") = Text2.Text Then
          form2.show
          unload.me
          Else
            MsgBox "信息错误!", vbExclamation + vbOKCancel, "登陆错误"
            Text1.Text = ""
            Text2.Text = ""
            Text1.SetFocus
         End If
        End If
      End If
    End If
End If
End Sub
请帮我看一下这个程序为什么登陆不另一个界面!谢谢了
搜索更多相关主题的帖子: thank  you  
2008-8-26 10:56
jxyga111
Rank: 12Rank: 12Rank: 12
来自:中華人民共和國
等级:版主
威望:11
帖子:4291
积分:5377
注册:2008-3-21

會打開啊,你再把錯的地方發一下

烈焰照耀世界,斌凍凍千萬裏
閉關修煉尋仙.....
2008-8-26 17:16
wilsonfu007
Rank: 1
等级:新手上路
帖子:10
积分:212
注册:2008-8-22

没有出现任何错误,就是不能判断输入的用户名和密码,并且不会登陆到另一个界面。麻烦大家了。
2008-8-27 12:09
wilsonfu007
Rank: 1
等级:新手上路
帖子:10
积分:212
注册:2008-8-22
thank you

不知怎么可以打开了,真是莫名其妙。谢谢了。顺便将代码上传。简单!
2008-8-27 19:52
vip99
Rank: 1
等级:新手上路
帖子:6
积分:174
注册:2008-8-31

Private Sub Command1_Click()
     '检查正确的密码
  If Text1 = "2008520" Then
        Form2.Show
'form2为您登陆成功后希望弹出的窗口
        Me.Hide
        End If
    If Text1 <> "密码 " Then
        Form3.Show  
'form3为您登陆失败后希望弹出的窗口
        Me.Hide
        End If
End Sub
2008-8-31 08:15
zss427607
Rank: 1
等级:新手上路
帖子:27
积分:348
注册:2008-10-28

是呀
2008-10-30 13:06
sputnik
Rank: 1
等级:新手上路
帖子:3
积分:102
注册:2006-2-18

学习中
2008-11-14 20:32
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.056058 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved