工业单据如何执行sql 语句(三种方法):
1.Set rs = SQLHelper.ExecuteSQL(strSQL, "")
2.
Private obj As New K3ClassEvents.BillEvent
Set rs = obj.K3Lib.GetData(sql)
3.
rs.Open sql, m_BillTransfer.Cnnstring, 1, 1
工业单据获取最大行:
'*****************************************
'获取分录行数
'*****************************************
Public Function GetEntryMax() As Long
Dim k As Long
Dim iFItemID As Long
Dim oEntryCtl As Variant
Dim maxrow As Long '最大行'
For k = LBound(m_BillTransfer.EntryCtl) To UBound(m_BillTransfer.EntryCtl)
If UCase(m_BillTransfer.EntryCtl(k).FieldName) = UCase("FItemID") Then '物料代码所在列
iFItemID = k
Exit For
End If
Next k
oEntryCtl = m_BillTransfer.EntryCtl
maxrow = UBound(oEntryCtl(iFItemID).DInterID) '获取表体最大行
GetEntryMax = maxrow
End Function
工业单据 获取某个字段所在的序号
'获取工序汇报单单据头上 生产任务单号 工序计划单号 工序号 物料内码
'获取工序汇报单单据头上 生产任务单号 工序计划单号 工序号 物料内码
Dim i As Integer
For i = LBound(m_BillTransfer.HeadCtl) To UBound(m_BillTransfer.HeadCtl)
'生产任务单单号
If (m_BillTransfer.HeadCtl(i).FieldName = "FICMONO") Then
FICMONO = m_BillTransfer.GetHeadText(i)
End If
'工序计划单号
If (m_BillTransfer.HeadCtl(i).FieldName = "FWBNO") Then
FWBNO = m_BillTransfer.GetHeadText(i)
End If
'工序号
If (m_BillTransfer.HeadCtl(i).FieldName = "FOperID") Then
FOPERNO = m_BillTransfer.GetHeadText(i)
End If
'物料代码
If (m_BillTransfer.HeadCtl(i).FieldName = "FItemID") Then
FNumber = m_BillTransfer.GetHeadNumber(i)
End If
Next
'获取当前单据体上的合计数量
Dim iFItemID As Integer
For k = LBound(m_BillTransfer.EntryCtl) To UBound(m_BillTransfer.EntryCtl)
If UCase(m_BillTransfer.EntryCtl(k).FieldName) = UCase("FAuxQtyfinish") Then '物料代码所在列
iFItemID = k
Exit For
End If
Next k