新手使用VB6.0 时 提示“用户定义类型未定义”
毕业做一个项目:教学管理系统 需要用 VB6.0和SQL Server做了两个 窗体界面 代码页书写完毕
在调试 运行时总是提示:“用户定义类型未定义” 困扰多天!!!谢谢~~~~·
窗体代码:Const MaxLogTimes As Integer = 5
Dim objAdmin As Recordset
Dim objTeacher As Recordest
Dim objStudent As Recordset
Private Sub cmdOK_Click()
If Trim(txtName) = "" Then
MsgBox "请输入用户名!", vbExclamation, "登录验证"
End Sub
Private Sub Form_Load()
txtName = ""
txtPwd = ""
cmbType.AddItem "学生"
cmbType.AddItem "教师"
cmbType.AddItem "系统管理员"
cmbType.ListIndex = 0
Dim objCn As New Collection
With objCn
.Provider = "SQLOLEDB"
.ConnectionString = "User ID=sa;PWD=123;Data Source=(local);" & "Initial Catalog=教学信息"
.Open
End With
Set objadimn = New Recordset
With objAdmin
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "SELECT*FROM 管理员", objCn
Set .ActiveConnection = Nothing
End With
Set objTeacher = New Recordset
With objTeacher
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "SELECT 编号,姓名 FROM 教师信息", objCn
Set .ActiveConnection = Nothing
End With
Set objTeacher = New Recordset
With objStudent
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.Open "SELECT 编号,姓名 FROM 学生信息", objCn
Set .ActiveConnection = Nothing
End With
objCn.Close
Set objCn = Nothing
End Sub
[[it] 本帖最后由 榆荚飞雪 于 2008-10-31 18:10 编辑 [/it]]