登陆页面的制作

一思路

登陆—Form-frmlogin

Start up Position=2

账号—Lable TextBox—txtUserID

密码—Lable TextBox—txtPassword

登陆,取消—CommangButton

 

Cmdlogin-default:ture-ENTER

Cmd Cancel-Cancel:ture-Esc

字体:大小:小一

所有控件的Tablnde*属性,0,1,2,3

Txt user ID

Txt password-1

Comd login-2

Cmd cancel-3

二程序

Option Explicit

Const MaxLoginTimes As Integer = 3

Private Sub comdlogin_click()

   Static loginTimes As Integer

   loginTimes = loginTimes + 1

   

   On Error GoTo App

   Dim cn As connection

   Dim rs As Recordset

   Dim strsql As String

   

   Set cn = New connection

   Set rs = New Recordset

   cn.connectionstring = "provider=microsoft.Jet.OLEDB.3.51;Date.soure= c:\User\if\Desktop\Text Example.mdb"

   cn.open

   rs.open (strsql)

   If rs.

一思路

登陆—Form-frmlogin

Start up Position=2

账号—Lable TextBox—txtUserID

密码—Lable TextBox—txtPassword

登陆,取消—CommangButton

 

Cmdlogin-default:ture-ENTER

Cmd Cancel-Cancel:ture-Esc

字体:大小:小一

所有控件的Tablnde*属性,0,1,2,3

Txt user ID

Txt password-1

Comd login-2

Cmd cancel-3

二程序

Option Explicit

Const MaxLoginTimes As Integer = 3

Private Sub comdlogin_click()

   Static loginTimes As Integer

   loginTimes = loginTimes + 1

   

   On Error GoTo App

   Dim cn As connection

   Dim rs As Recordset

   Dim strsql As String

   

   Set cn = New connection

   Set rs = New Recordset

   cn.connectionstring = "provider=microsoft.Jet.OLEDB.3.51;Date.soure= c:\User\if\Desktop\Text Example.mdb"

   cn.open

   rs.open (strsql)

   If rs.EOF = ture Then

       MsgBox txtUserID.Text&"不存在"

       Me.txt UserID.SetFocus

       Me.txt UserID.setstart = 0

       Me.txtUserID.SelLength = Len(Me.txtUserID.Text)

   Else

       If Rs.Field("Userpassword").Value=Me.txtpassword.Text.Then

       Msg box: 登陆成功

       Unload Me

       frm New Show

   Else

       MsgBox "密码错误"

     End If

   End If

ppp:

Else

   MsgBox "您的输入次数超过允许的最大错误次数"

End Sub

三实验结论

在connection联通的条件下,可以和数据表进行数据的双向运输Recordset

从而我们学习了一种新的语言(sql)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值