数据库添加记录不执行rs.Update是怎么回事?帮看看
以前一直使用的是ADODC现在在学着用语句,所以很多还没搞明白,下面的在执行完“rs.Fields("面积") = Trim(Text4.Text)”后没有执行rs.update直接跳到end sub怎么回事?请帮我看看!指点一下,谢谢!Set cn = New adodb.Connection
Set rs = New adodb.Recordset
If cn.State = adStateOpen Then cn.Close
If rs.State = adStateOpen Then rs.Close
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " & App.Path & "\fyxx.mdb;Jet OLEDB:Database Password=88 "
sql = "select * from czfy "
rs.Open sql, cn, 1, 3
rs.AddNew
rs.Fields("编号") = Trim(Label37.Caption)
rs.Fields("面积") = Trim(Text4.Text)
rs.Update
MsgBox "数据保存成功!", , "系统提示"
Call Form_Load
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
Check7.Value = 0
Check8.Value = 0
Check9.Value = 0
end sub
[ 本帖最后由 wxflw 于 2012-11-8 10:01 编辑 ]