首页上一页 1 下一页尾页 1 条记录 1/1页
请问一下类型不匹配匹配
发表在VB答疑区
2008-11-11
是否精华
是
否
版块置顶:
是
否
Dim con As New adodb.Connection
Dim rs As New adodb.Recordset
Private Sub Command1_Click()
con.Open "dsn=stud"
rs.Open "select*from xueshen", con, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields(1) = Trim(Text1.Text)
rs.Fields(2) = Trim(Text2.Text)
rs.Fields(3) = Combo1.Text
[font color=#FF0000] rs.Fields(4) = Trim(Text3.Text)
[/font] rs.Fields(7) = Trim(Text4.Text)
rs.Fields(8) = Trim(Text5.Text)
rs.Fields(9) = Trim(Text6.Text)
rs.Fields(5) = Str(DTPicker1.Value)
rs.Fields(6) = Str(DTPicker2.Value)
MsgBox "成功添加数据", 48, "学生宿舍管理系统"
rs.Update
Set xsbg.DataSource = con.Execute("select*from xueshen")
rs.Close
con.Close
End Sub
Dim rs As New adodb.Recordset
Private Sub Command1_Click()
con.Open "dsn=stud"
rs.Open "select*from xueshen", con, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields(1) = Trim(Text1.Text)
rs.Fields(2) = Trim(Text2.Text)
rs.Fields(3) = Combo1.Text
[font color=#FF0000] rs.Fields(4) = Trim(Text3.Text)
[/font] rs.Fields(7) = Trim(Text4.Text)
rs.Fields(8) = Trim(Text5.Text)
rs.Fields(9) = Trim(Text6.Text)
rs.Fields(5) = Str(DTPicker1.Value)
rs.Fields(6) = Str(DTPicker2.Value)
MsgBox "成功添加数据", 48, "学生宿舍管理系统"
rs.Update
Set xsbg.DataSource = con.Execute("select*from xueshen")
rs.Close
con.Close
End Sub