请问如何实现以下的一个登录界面?
功能如下:
根据用户输入的用户名和密码进行判断,如果同数据库内的useid和password相同,则进入操作界面。

解决方案 »

  1.   

    可以用sql语句来进行判断
    先用select查找出该用户 再用语句来判断 pw
      

  2.   

    private sub cmd_login()
     dim username as string
     dim userpass as string
     dim cn,fs,path 
     username=trim(text1.text)
     userpass=trim(text2.text)
    set cn=createobject("adodb.connection")
            cn.open "provider=microsoft.jet.oledb.4.0;data source=" & app.path & "\system.mdb"
    set fs=createobject("adodb.recordset")
     sql="select * from member where username='" & name & "' and userpass='" & userpass & "'"
          fs.open sql,cn,1,1
     if fs.eof then
              msgbox "对不起,登录错误",vbokonly+vbinformation,"系统消息"
     else
    ......
    end if