| 发表于:2007-06-18 12:47:59 楼主 |
private sub cmdcancel_click() unload me end sub private sub cmdok_click() dim mima mima = trim(text2.text) rs.open "select username,pwd from admin where username= ' " & trim(text1.text) & " ' and pwd= ' " & md5(mima) & " ' ", conn, adopenstatic, adlockreadonly, adcmdtext if rs.eof = true and rs.bof then beep msgbox "请重新登录 " text1.text = " " text1.setfocus else form1.hide end if rs.close end sub private sub form_load() login.caption = "登陆窗口 " login.top = (screen.height - login.height) / 2 login.left = (screen.width - login.width) / 2 '窗口居中 dim conn as new adodb.connection dim rs as new adodb.recordset conn.connectionstring = "driver={sql server};server=wangxinfei;uid=sa;pwd=;database=library " conn.connectiontimeout = 30 conn.open '连接数据库 label1.caption = "用户名: " label2.caption = "密码: " text1.text = " " text2.text = " " cmdok.caption = "确定 " cmdcancel.caption = "取消 " end sub 刚刚学习vb 谢谢您!! |
|
|
|
|