运行程序的时候显示:ado无效文件名..
Private Sub cmdok_Click()
rtn = SetWindowPos(Me.hwnd, -2, 0, 0, 0, 0, 3) '运用API函数SetWindowPos,来实现取消窗体置前的功能
On Error Resume Next
Dim MPassword As String
Dim Name1 As String
If Trim(Text1.Text) = "" Or Trim(Text2.Text) = "" Then
MsgBox "输入用户名或密码不能为空,请您确认后重新输入", , "天启人事管理系统"
End If
Text1.Text = ""
Text1.SetFocus
If Trim(Text1.Text) = "pengpeng" And Trim(Text2.Text) = "16682589" Then '判断是否使用的是超级口令登录
tq_main.StatusBar1.Panels.Item(2).Text = "当前操作员:pengpeng"
Unload Me
tq_main.Show
Else
Adodc1.RecordSource = "select * from login where use_id ='" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MPassword = Adodc1.Recordset.Fields("password")
If Text2.Text = MPassword Then '判断数据的密码是否正确
tq_main.StatusBar1.Panels.Item(2).Text = "当前操作员: " + Adodc1.Recordset.Fields("use_id")
frm_main.Show
Unload Me
Else
MsgBox "密码不正确,请您确认后重新输入", , "天启人事管理系统"
Text1.Text = ""
Text1.SetFocus
End If
Else
MsgBox "对不起 没有此用户的信息", , "天启人事管理系统"
Text2.Text = ""
Text1.Text = ""
End If
End If
End Sub
Private Sub cmdend_Click()
End
End Sub
Private Sub Form_Load()
If App.PrevInstance Then
MsgBox "您已经启动了本程序"
End
End If
rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3) '运用API函数SetWindowPos,来实现使窗体置前的功能
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:" & App.Path & "\data\ppdata.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from login"
Adodc1.CommandType = adCmdText
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub ScreenCenter()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call cmdok_Click
End If
End Sub