请问在这两部分代码里面那一部分加上相应函数或代码可以实现:
若下拉Combo1控件时没有用户名,则进入一添管理员用户名和密码的窗体?
此为登录界面部分代码:
Private Sub Combo1_Click()
Dim rsload As ADODB.Recordset
Set rsload = New ADODB.Recordset '对记录集实例化
Call check_condatabase '检查数据库是否连接
If rsload.State = 1 Then rsload.Close '打开纪录集获得该用户的密码
rsload.Open "select user_psw from user_load where user_name='" & Combo1.Text & "'", cn, adOpenStatic, adLockPessimistic
txtPassword.SetFocus '对密码文本框设置焦点
chkpassword = Trim(rsload.Fields("user_psw")) '去掉空格串
End Sub
Private Sub Form_Load()
Dim rsload As ADODB.Recordset '设置记录集并连接user_load
txtPassword.Text = "" '清空密码文本
Call condatabase
Set rsload = New ADODB.Recordset '连接数据库
rsload.Open "select * from user_load ", cn, adOpenStatic, adLockPessimistic
Combo1.Clear '清空下拉列表框
Do Until rsload.EOF '加载用户名称
Combo1.AddItem rsload.Fields("user_name")
rsload.MoveNext
End Sub
[此贴子已经被作者于2007-5-14 23:21:55编辑过]