VB6数据报告与使用ADO Shape的数据源不匹配

时间:2015-11-18 01:45:37

标签: vb6 report ado

我正在努力让datareport工作,因为dataflexgrid已经在工作,虽然我很难将值传递给datareport,但我甚至无法通过,请帮助谢谢。

PS。所有这些都是一种形式

Set mRS = New ADODB.Recordset
mRS.CursorLocation = adUseClient
mRS.CursorType = adOpenForwardOnly
mRS.LockType = adLockReadOnly

If mRS.State = 1 Then mRS.Close

mRS.Open "SHAPE {" & _
        "SELECT " & _
        "space(memberstree.level*6) + customer.description, " & _
        "customer.customercode, " & _
        "customer.remarks, " & _
        "customer.membersince " & _
    "From CUSTOMER " & _
        "INNER JOIN memberstree on customer.customercode = memberstree.customercode " & xRootNode & " " & _
        "ORDER by memberstree.pedigree + ltrim(str(memberstree.node,6,0))} AS rsCustomer " & _
        "APPEND (( SHAPE {SELECT transactionNo, logdate, customercode, GrandTotal " & _
    "From FinishedTransaction where " & xCriteria & "} AS rsTransaction " & _
        "APPEND ({SELECT TransactionNo, Description, Qty From FinishedSales} As rsSales " & _
        "RELATE TransactionNo TO TransactionNo))" & _
        " RELATE customercode TO customercode)", gCNMark
 mRS.Requery

Set MSHFlexGrid1.DataSource = mRS

我认为这是无效的代码

With rptShape
Set .DataSource = mRS
.DataMember = ""


    With .Sections("FinishedSales_Detail").Controls
    .Item("txtDescription").DataMember = "rsSales"
    .Item("txtDescription").DataField = "Description"
    End With

。显示1

1 个答案:

答案 0 :(得分:0)

现在好了,我有3个带有2个SHAPE命令的TABLE,但在数据报告中我有3个Group Header,也应该是2个。

相关问题