Dim intI As Integer
    For intI = 0 To Adodc1.Recordset.Fields.Count - 1
        Adodc1.Recordset.Fields(i).Value = "Your String"
    Next intIPS:不是整个字段,是全部字段

解决方案 »

  1.   

    strTmp = "UPDATE Table1 SET a ='加'"
      

  2.   

    完整代码如下:
    Dim cmS As ADODB.Command    Set cmS = New ADODB.Command
        cmS.ActiveConnection = cnn
        cmS.CommandType = adCmdText    strTmp = "UPDATE DB_Details SET cDBCode ='" & txtCode.Text & "' where cDBCode=''"
        cmS.CommandText = strTmp
        cmS.Execute
      

  3.   

    adodc1.recordset.movefirst
    do until adodc1.recordset.eof
    adodc1.recordset!a = "加"
    adodc1.recordset.update
    adodc1.recordset.movenext
    loopadodc1.refresh
      

  4.   

    to gump2000(阿甘) ( ) 
    Private Sub Command1_Click()
    Dim intI As Integer
        For intI = 0 To Adodc1.Recordset.Fields.Count - 1
            Adodc1.Recordset.Fields("部").Value = "还"
        Next intI
     Adodc1.Recordset.MoveNext
    End Sub
    实时错误'-2147217842(80040)e4e)'
    错误:查询过于复杂
      

  5.   

    原来我用
    Private Sub Command1_Click()
    Dim FieldNnames, FieldValues
        Adodc1.Recordset.MoveFirst
        While Not Adodc1.Recordset.EOF
        FieldNnames = Array("部")
        FieldValues = Array("还")
        Adodc1.Recordset.AddNew FieldNnames, FieldValues
        Adodc1.Recordset.MoveNext
        Wend
    End Sub
    但是只能在字段中加上几个数据
      

  6.   

    '楼主掉了这一句
    Adodc1.Recordset.Update
      

  7.   

    with adodc1.recordset
        if not .eof and .bof then
               .movefirst
        endif    do while not .eof 
            .fields("a")="加"
            .update
            .movefirst
        loop  adodc1.refresh
      dbgrid1.refresh这样应该可以了吧,同意以上的说法。但,还是建议你使用SQL语句来成批更新,这样效率比较高一点。哈哈