我想实现server数据库的更新。情问怎么实现。
就是说,我想吧表里已经有的一个值,想把它换成另一个值。

解决方案 »

  1.   

    dim cn as new adodb.connectioncn.connectionstring="........"
    cn.open
    cn.execute "update set 字段名='新值' where 字段名='原值'"
      

  2.   

    cn.execute "update 表名 set 字段名='新值' where 字段名='原值'"
      

  3.   

    Dim mrc As ADODB.Recordset
      Dim txtsql As String
      Dim msgtext As String
      txtsql = "update face_info set 开始时间 =' " & Trim(Text3.text) & " ' where 开始时间 like '" & Trim(Me.MSHFlexGrid1.TextMatrix(Me.MSHFlexGrid1.Row, 1)) & " '"
      Set mrc = ExecuteSQL(txtsql, msgtext)
           mrc.update
           mrc.Close
    这是我的代码,提示是修改成功,可数据库里的没变化,是怎么会事,拜托了,谢谢了先
      

  4.   

    在mrc.update和mrc.close之间加一段mrc.refresh,就是刷新的功能(试试)
      

  5.   

    这是sever 数据库,不是access数据库呀,
      

  6.   

    把Dim mrc As ADODB.Recordset改为 Dim mrc As New ADODB.Recordset再试试