一个sql数据保存的问题
请问我想在这个窗口中直接改数据,然后保存,怎么实现呢?我用的是SQL后台数据库!代码如下:实例图附件
Private Sub Command1_Click()
bz
rs.CursorLocation = adUseClient
rs.Open "SELECT dbo.info2005_student.name AS 姓名,dbo.info2005_student.sexID AS 学生编号,dbo.info2005_student.classID AS 班级,dbo.info2005_student.age AS 年龄, dbo.info2005_student.shuoming AS 说明,dbo.info2005_teacher.teachername AS 班主任,dbo.info2005_teacher.teachertel AS 班主任电话 FROM dbo.info2005_student INNER JOIN dbo.info2005_teacher ON dbo.info2005_student.classID = dbo.info2005_teacher.teacherclass ORDER BY dbo.info2005_student.sexID", con, adOpenForwardOnly, adLockOptimistic
MsgBox "数据库中已经存在:" & rs.RecordCount & "位学生", vbInformation + vbOKOnly, "" & Form1.Caption
Set DataG1.DataSource = rs
DataG1.Caption = "学 生 信 息 浏 览"
DataG1.AllowRowSizing = True
DataG1.AllowDelete = True
DataG1.AllowUpdate = True
DataG1.AllowAddNew = True
Set rs = Nothing
Exit Sub
End Sub