大哥,update不行就用updatebatch试一下,如果都不行就把源程序拿上来看一下吧。
我也有过同样的经历。

解决方案 »

  1.   

    If IsNull(rst.Fields("archive_id")) Then
             rst.Fields("archive_id") = "c000"
            Else
                rst.Fields("archive_id") = "c" & Format(Val(Right(rst.Fields("archive_id"), 3)) + 1, "000")
             End If
                    
           ' rst.Fields("archive_id") = "C" & Format(Val(Right(rst.Fields("archive_record_id"), 3)) + 1, "000")
             ' ‘单位简称
            If txtabbre.Text = "" Then
                  MsgBox "单位简称不能为空!", vbCritical + vbOKOnly, "警告"
                  txtabbre.SetFocus
                  Exit Sub
            End If
            rst.Fields("company_abbre") = txtabbre.Text
            '  '档案类别
            If txttype.Text = "" Then
                MsgBox "档案类别不能为空!", vbCritical + vbOKOnly, "警告"
                txttype.SetFocus
                Exit Sub
            End If
             rst.Fields("archive_type_name") = txttype.Text
               
           '档案日期
            If TxtSDate.Text = "" Then
                rst.Fields("start_date") = Date
            Else
               rst.Fields("start_date") = TxtSDate.Text
            End If
            
            If TxtEDate.Text = "" Then
                rst.Fields("end_date") = Date
            Else
               rst.Fields("end_date") = TxtEDate.Text
            End If
           '报费日期
           
             If txtreject.Text = "" Then
                 rst.Fields("reject_date") = Date
             Else
               rst.Fields("reject_date") = txtreject.Text
            End If
          '  档案柜
             If lblcart1.Caption = "" Then
               rst.Fields("cartulary1") = 4
             Else
               rst.Fields("cartulary1") = lblcart1.Caption
            End If
               If lblcart2.Caption = "" Then
                  rst.Fields("cartulary2") = 4
                Else
               rst.Fields("cartulary2") = lblcart2.Caption
            End If
      
           If lblcart3.Caption = "" Then
                  rst.Fields("cartulary3") = 4
                Else
               rst.Fields("cartulary3") = lblcart3.Caption
            End If
       '保存年限
          If txtyear.Text = "" Then
              rst.Fields("wastage_year") = 15
            Else
              rst.Fields("wastage_year") = txtyear.Text
        End If
       '档案说明
         If txtmemo.Text = "" Then
              rst.Fields("memo") = ""
        Else
              rst.Fields("memo") = txtmemo
        End If
         rst.Fields("status") = "未确认"
         rst.Fields("verify_name") = username
         rst.Fields("verify_date") = logindate
         rst.Fields("create_name") = username
        rst.Fields("create_date") = Date
         rst.Update
        执行此处后,不会把记录写进行表中,请帮我一下好吗?各位高手?
         Set DataGrid1.DataSource = rst