Foxtable(狐表)用户栏目专家坐堂 → [求助]


  共有3281人关注过本帖树形打印复制链接

主题:[求助]

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/3/1 20:17:00 [显示全部帖子]

那你还不如删除所有表数据,再重新添加数据,效率绝对比你查找数据要来得高

 

If msgbox("导入更新可以导入客户基础数据和最新的存款余额和年日均余额,是否进行?",65,"提示") = 1 Then
    DataTables("对公客户明细").DataRows.Clear
    Dim Book As New XLS.Book("D:\khdaxt\drgx\dgdrgx.xls")
    Dim Sheet As XLS.Sheet = Book.Sheets(0)
    DataTables("对公客户明细").StopRedraw()
    Dim nms() As String = {"账号","客户号","户名","账户性质","开户日期","存款余额","年日均余额"}
    For n As Integer = 0 To Sheet.Rows.Count -1
        Dim bh As String = sheet(n,0).Text
        'Dim dr As DataRow = DataTables("对公客户明细").Find("账号 = '" & bh & "'")
        Dim dr As DataRow = DataTables("对公客户明细").AddNew
        If dr Is Nothing Then '如果不存在同编号的订单
            dr =  DataTables("对公客户明细").AddNew()
        End If
        For m As Integer = 0 To nms.Length -1
            dr(nms(m)) = trim(Sheet(n,m).Value)
        Next
    Next
    DataTables("对公客户明细").ResumeRedraw()
    msgbox("客户数据导入更新完毕!",64,"提示")
End If


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/3/1 20:39:00 [显示全部帖子]

If msgbox("导入更新可以导入客户基础数据和最新的存款余额和年日均余额,是否进行?",65,"提示") = 1 Then
    Dim Book As New XLS.Book("D:\khdaxt\drgx\dgdrgx.xls")
    Dim Sheet As XLS.Sheet = Book.Sheets(0)
    DataTables("对公客户明细").StopRedraw()
    Dim nms() As String = {"账号","客户号","户名","账户性质","开户日期","存款余额","年日均余额"}
    Dim zhs As String = ""
    For n As Integer = 0 To Sheet.Rows.Count -1
       
        Dim bh As String = sheet(n,0).Text
        zhs &= "'" & bh & "',"
        Dim dr As DataRow = DataTables("对公客户明细").Find("账号 = '" & bh & "'")
        If dr Is Nothing Then '如果不存在同编号的订单
            dr =  DataTables("对公客户明细").AddNew()
        End If
        For m As Integer = 0 To nms.Length -1
            dr(nms(m)) = trim(Sheet(n,m).Value)
        Next
    Next
    DataTables("对公客户明细").DeleteFor("账号 not in (" & zhs.Trim(",") & ")")
    DataTables("对公客户明细").ResumeRedraw()
    msgbox("客户数据导入更新完毕!",64,"提示")
End If

 回到顶部