想把数据库A的数据updata到数据库B里,写好了SQL语句,却不知道该写在哪里了 请写在什么控件的代码里,大概怎么写?

解决方案 »

  1.   

    Dim cnn As New ADODB.Connection
    Dim s As String
    s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=计算.mdb;Persist Security Info=False"
    Set cnn = New ADODB.Connection
    cnn.Open s
    Dim strchtc As String
    strchtc = "update gztc,chtc set gztc.创汇提成=chtc.Expr1000 where gztc.ID=chtc.ID"
    cnn.Execute strchtc
    cnn.close
      

  2.   

    conn.execute "Update 表2 set uname='" & text1.text & "' where id=1 "