34,593
社区成员
发帖
与我相关
我的任务
分享
Cmd.CommandText = "select * from tmp where name in (select name from data) and account in (select account from data) and subject in (select subject from data) and iounumber in (select iounumber from data)"
Dr = Cmd.ExecuteReader(CommandBehavior.Default)
If Dr.HasRows = True Then
While Dr.Read
B = CDbl(Dr.Item("贷").ToString())
TA = Dr.Item("account")
TS = Dr.Item("subject")
TC = Dr.Item("iounumber")
C = Dr.Item("name")
Cmd.Connection = Oledb2
Cmd.CommandText = "update data set 贷" & V & "=convert(money,'" & (B) & "') where name='" & (C) & "' and account='" & (TA) & "' and subject='" & (TS) & "' and iounumber='" & (TC) & "'"
Cmd.ExecuteNonQuery()
End While
End If
Dr.Close()
Oledb2.Close()
Cmd.Connection = Oledb1
Cmd.CommandText = "delete from tmp where name in (select name from data) and account in (select account from data) and subject in (select subject from data) and iounumber in (select iounumber from data)"
Cmd.ExecuteNonQuery()
Cmd.CommandText = "insert into data(type,subject,account,name,[currency],IouNumber,贷" & V & ") select type,subject,account,name,[currency],IouNumber,贷 from tmp"
Cmd.ExecuteNonQuery()