求指教下这段添加数据
下面这段添加数据,为什么总是添加不上呢,表里始终没反映,我用的ACCESS数据库
Public cn As New ADODB.Connection
Public rs As New ADODB.Recordset
Private Sub CommInsert_Click()
Dim sqlstr As String
sqlstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\WBSF\DATA.mdb;Persist Security Info=False"
cn.Open sqlstr
sql = "select * from StuInfo"
rs.Open sql, cn, 3, 3
rs.AddNew
rs("StuID") = txtStuID.Text
rs("StuName") = txtStuName.Text
rs("StuPass") = txtPass.Text
rs("StuProfessional") = txtPro.Text
rs("StuClasses") = txtClass.Text
rs("StuMoney") = txtMoney.Text
End Sub