用VB写了如下的程序,可是为什么一运行,就显示“找不到可安装的isAM”,请帮忙啊,程序如下
PrivateDBAsADODB.ConnectionPrivateRSAsADODB.RecordsetPrivateSubcmdOK_Click()DimiAsInt...
Private DB As ADODB.Connection
Private RS As ADODB.Recordset
Private Sub cmdOK_Click()
Dim i As Integer
For i = 1 To RS.RecordCount
RS.AbsolutePosition = i
If Trim(RS("用户名称")) = Text1.Text And Trim(RS("用户密码")) = Text2.Text And Trim(RS("用户密码")) = Combo1.Text Then
Select Case Trim(RS("用户名称"))
Case "管理员"
manager.Show
Unload Form1
Exit For
Case "教师"
teacher.Show
Unload Form1
Exit For
Case "学生"
student.Show
Unload Form1
Exit For
End Select
Else
If i = RS.RecordCount Then
MsgBox "重新输入", , "登陆"
End If
End If
Next
End Sub
Private Sub Form_Load()
With cmbUserType
.AddItem "管理员"
.AddItem "教师"
.AddItem "学生"
End With
Set DB = New ADODB.Connection
DB.Open "Provider = microsoft.jet.oledb.4.0;date source= " & App.Path & "\EMS.mdb" ’调试时此行出错
Set RS = New ADODB.Recordset
RS.Open "login", DB, adOpenKeyset, adLockOptimistic
End Sub 展开
Private RS As ADODB.Recordset
Private Sub cmdOK_Click()
Dim i As Integer
For i = 1 To RS.RecordCount
RS.AbsolutePosition = i
If Trim(RS("用户名称")) = Text1.Text And Trim(RS("用户密码")) = Text2.Text And Trim(RS("用户密码")) = Combo1.Text Then
Select Case Trim(RS("用户名称"))
Case "管理员"
manager.Show
Unload Form1
Exit For
Case "教师"
teacher.Show
Unload Form1
Exit For
Case "学生"
student.Show
Unload Form1
Exit For
End Select
Else
If i = RS.RecordCount Then
MsgBox "重新输入", , "登陆"
End If
End If
Next
End Sub
Private Sub Form_Load()
With cmbUserType
.AddItem "管理员"
.AddItem "教师"
.AddItem "学生"
End With
Set DB = New ADODB.Connection
DB.Open "Provider = microsoft.jet.oledb.4.0;date source= " & App.Path & "\EMS.mdb" ’调试时此行出错
Set RS = New ADODB.Recordset
RS.Open "login", DB, adOpenKeyset, adLockOptimistic
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询