Dim sturst As ADODB.Recordset
Private Sub showrst(temp As ADODB.Recordset)
text_id.Text = temp.Fields(0)
text_name.Text = temp.Fields(1)
Text_sex.Text = temp.Fields(2)
Text_class.Text = temp.Fields(3)
End Sub
Public Sub stufrm_Load()
sturst = New ADODB.Recordset
sturst.CursorTyp = adOpenDynamic
sturst.LockType = adLockOptimistic
sturst.Open "students", cn, , , adCmdTable
If sturst.EOF Then
text_id.Text = ""
text_name.Text = ""
Text_sex.Text = ""
Text_class.Text = ""Else
showrst sturst
End If
End Sub
其中cn为模板变量:public cn as adodb.connection
Private Sub showrst(temp As ADODB.Recordset)
text_id.Text = temp.Fields(0)
text_name.Text = temp.Fields(1)
Text_sex.Text = temp.Fields(2)
Text_class.Text = temp.Fields(3)
End Sub
Public Sub stufrm_Load()
sturst = New ADODB.Recordset
sturst.CursorTyp = adOpenDynamic
sturst.LockType = adLockOptimistic
sturst.Open "students", cn, , , adCmdTable
If sturst.EOF Then
text_id.Text = ""
text_name.Text = ""
Text_sex.Text = ""
Text_class.Text = ""Else
showrst sturst
End If
End Sub
其中cn为模板变量:public cn as adodb.connection
------------------------
改成:
public sub form_load()
系统提示错误:private sub form_load()为无效属性
是不是我的软件有问题呀
sturst.CursorTyp 应改为 sturst.Cursortype