Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共12 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:7.2和7.9发现的错误

1楼
blackzhu 发表于:2010/7/9 8:31:00

   7.2和7.9更新我的系统出来一个错误,7.2之前一直正常.这个表里的代码有以下:

 

If e.Datacol.Name  = "IO" Then
    If e.Datarow.IsNull("IO") Then
        e.Datarow("序号") = DBNull.Value
    Else
        e.Datarow("序号")= Format(e.Datatable.Compute("Count(IO)","[IO] = '" & e.Datarow("IO") & "' And [_identify] < 100" & e.Datarow("_Identify")))
    End If
End If

If e.Datacol.Name = "IO" Then
    If e.Datarow.IsNull("IO")  Then
        e.Datarow("辅料编号") = DBNull.Value
        e.Datarow("辅料名称") = DBNull.Value
        e.Datarow("颜色") = DBNull.Value
        e.Datarow("尺码") = DBNull.Value
        e.Datarow("单耗") = DBNull.Value
        e.Datarow("单价") = DBNull.Value
        e.Datarow("单位") = DBNull.Value
        e.Datarow("供应商编号") = DBNull.Value
        e.Datarow("供应商名称") = DBNull.Value
        e.Datarow("单耗") = DBNull.Value
        e.Datarow("订购项目") = DBNull.Value
        e.Datarow("实际订购数") = DBNull.Value
        e.Datarow("补订数量") = DBNull.Value
        e.Datarow("商标") = DBNull.Value
        e.Datarow("订购日期") = DBNull.Value
        e.Datarow("损耗") = DBNull.Value
        e.Datarow("订购单编号") = DBNull.Value
        e.Datarow("交货日期") = DBNull.Value
        e.Datarow("要求订购数") = DBNull.Value
        e.Datarow("进仓日期") = DBNull.Value
        e.Datarow("进仓单号") = DBNull.Value
        e.Datarow("送货数量") = DBNull.Value
        e.Datarow("计划订单数") = DBNull.Value
        e.Datarow("箱号") = DBNull.Value
        e.Datarow("提单号") = DBNull.Value
        e.Datarow("快邮号码") = DBNull.Value
        e.Datarow("fa piao号码") = DBNull.Value
        e.Datarow("是否结帐") = DBNull.Value
        e.Datarow("领用日期") = DBNull.Value
        e.Datarow("出库单号") = DBNull.Value
        e.Datarow("领用数量") = DBNull.Value
        e.Datarow("领用部门") = DBNull.Value
        e.Datarow("领用人") = DBNull.Value
        e.Datarow("门幅") = DBNull.Value
    End If
End If

If e.DataCol.Name = "辅料编号" Then
    If e.Datarow.IsNull("辅料编号")  Then
        e.Datarow("辅料名称") = DBNull.Value
        e.Datarow("规格") = DBNull.Value
        e.Datarow("颜色") = DBNull.Value
        e.Datarow("尺码") = DBNull.Value
        e.Datarow("单耗") = DBNull.Value
        e.Datarow("单价") = DBNull.Value
        e.Datarow("单位") = DBNull.Value
        e.Datarow("供应商编号") = DBNull.Value
        e.Datarow("供应商名称") = DBNull.Value
    Else
        Dim dr As DataRow
        dr = DataTables("价目表").Find("辅料编号 = '" & e.DataRow("辅料编号") &"'")
        If dr IsNot Nothing Then
            e.DataRow("辅料名称") = dr("辅料名称")
            e.DataRow("规格") = dr("规格")
            e.datarow("颜色")= dr("颜色")
            e.DataRow("尺码") = dr("尺码")
            e.datarow("单耗")= dr("单耗")
            e.DataRow("单价") = dr("单价")
            e.datarow("单位")= dr("单位")
            e.DataRow("供应商编号") = dr("客户编号")
            e.datarow("供应商名称")= dr("客户名称")
            e.datarow("门幅")= dr("门幅")
        End If
    End If
End If

If e.DataCol.Name = "订购日期" Then
    If e.Datarow.IsNull("订购日期")  Then
        e.Datarow("订购单编号") = DBNull.Value
        e.Datarow("计划订单数") = DBNull.Value
    Else
        e.DataRow("计划订单数") = DataTables("订单明细").Compute("Sum(TOTAL)","[IO] = '" & e.DataRow("IO") & "'")
    End If
End If

If e.DataCol.Name = "订购日期" Then
    If e.Datarow.IsNull("订购日期")  Then
        e.Datarow("订购单编号") = DBNull.Value
    Else
        Dim cmd As New SQLCommand
        Dim dt As DataTable
        Dim dr As DataRow = e.DataRow
        cmd.C
        cmd.CommandText = "SELECT * From {批号申请} Where [IO] = '" & dr("IO") & "'And [客户编号] = '" & e.dataRow("供应商编号") & "'AND [申请日期]='" & e.datarow("订购日期") & "'"
        dt = cmd.ExecuteReader
        If dt.DataRows.Count > 0 Then
            dr("订购单编号") = dt.DataRows(0)("订购单编号")
        End If
    End If
End If
If e.Datacol.Name = "IO" Then
    If e.Datarow.IsNull("IO")  Then
        e.Datarow("商标") = DBNull.Value
    Else
        Dim cmd As New SQLCommand
        Dim dt As Datatable
        Dim dr As Datarow = e.Datarow
        cmd.C
        cmd.CommandText = "SELECT * From {订单情况} Where [IO] = '" & dr("IO") & "'"
        dt = cmd.ExecuteReader
        If dt.DataRows.Count > 0 Then
            dr("商标") = dt.DataRows(0)("商标")
        End IF
    End IF
End IF

 

出来的错误如图:

 


图片点击可在新窗口打开查看此主题相关图片如下:7.2和7.9错误.jpg
图片点击可在新窗口打开查看
2楼
狐狸爸爸 发表于:2010/7/9 8:40:00
贴出辅料明细表的CurrentChanged事件代码
3楼
blackzhu 发表于:2010/7/9 8:51:00

上面就是全部的代码,没有什么特别的,我全部贴出了.

4楼
狐狸爸爸 发表于:2010/7/9 9:03:00
错误提示就是辅料明细的CurrentChanged事件
5楼
blackzhu 发表于:2010/7/9 9:10:00
我知道呀,但是我用了一年多的代码,到最近两次错误提示,这是怎么回事?
6楼
狐狸爸爸 发表于:2010/7/9 9:23:00
因为7.2改写了筛选和排序代码
7楼
狐狸爸爸 发表于:2010/7/9 9:38:00
你贴的不是CurrentChanged的代码,因为该事件的e参数不会是e.DataRow
8楼
blackzhu 发表于:2010/7/9 10:18:00
以下是引用狐狸爸爸在2010-7-9 9:38:00的发言:
你贴的不是CurrentChanged的代码,因为该事件的e参数不会是e.DataRow

的确贴错了,应该是这一句:

 

  With Tables("辅料明细")
    If .Current Is Nothing Then
        Tables("集合输入_Table20").Filter= "False"
    Else
        Tables("集合输入_Table20").Filter = "商标 = '" & Tables("辅料明细").Current("商标") & "'"
    End If
End With

 

帮我看看!

9楼
reachtone 发表于:2010/7/9 10:20:00
Tables("集合输入_Table20").Filter= ""
10楼
狐狸爸爸 发表于:2010/7/9 10:26:00
With Tables("辅料明细")
    If .Position < 0  Then
        Tables("集合输入_Table20").Filter= "False"
    Else
        Tables("集合输入_Table20").Filter = "商标 = '" & Tables("辅料明细").Current("商标") & "'"
    End If
End With
共12 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.