首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我使用SHAPE命令创建了ADO记录集。现在如何将数据报告文本框与vb6中的结果集字段绑定?

我使用SHAPE命令创建了ADO记录集。现在如何将数据报告文本框与vb6中的结果集字段绑定?
EN

Stack Overflow用户
提问于 2013-07-30 09:15:33
回答 2查看 1.3K关注 0票数 1

我的记录集已成功地用ADO填充。但是现在如何将它与vb6中的数据报告文本字段连接起来呢?请帮帮忙?我的查询如下。

代码语言:javascript
复制
   str = "SHAPE {select * from sale where sale_from_id='" & firmName &
         "' and ret_id='" & Trim(txtRetId) & "' and date >=#" &
       Format(dtpFrom.value, "MM-DD-YYYY") & "# and date <= #" &
       Format(dtpTo.value, "MM-DD-YYYY") & "#}" _
                   & " APPEND ((SHAPE {select  sd.sale_id,sd.sdet_id,sd.item_id,i.item_name,sd.qty,sd.sdet_price,sd.sub_total
       from sale_detail sd, item i where i.item_id = sd.item_id}" _
                          & " APPEND({select * from sale_serial} AS sale_serial" _
                                  & " RELATE sdet_id TO sdet_id )) AS sale_detail" _
                         & " RELATE sale_id TO sale_id ) AS sale"
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-09-09 09:01:45

把这段代码写在这里我把我的代码

代码语言:javascript
复制
       InvSql = "   SHAPE {SELECT * FROM `sales`}  AS salesgroup COMPUTE  salesgroup,   COUNT(salesgroup.'units') AS Aggregate1, <br/>SUM(salesgroup.'price') AS    Aggregate2, SUM(salesgroup.'total') AS Aggregate3 BY 'mname'" 


Set invReport = New ADODB.Recordset
 invReport.Open InvSql, cn
    invReport.Requery
Set rssum = New ADODB.Recordset
sumSql = "select amount  from credit where billno='BL001'"
rssum.Open sumSql, cn
rssum.Requery
 rptdealer.Sections("Section5").Controls.Item("Label5").Caption = "Rs." & rssum(0).Value
    Set rptdealer.DataSource = invReport
rptdealer.Show

 goto report page and insert group footer and group header place ur texbox and lables
get into code behind page of report page 

Private Sub DataReport_Initialize()
On Error Resume Next
   Move 0, 0
   Me.Caption = "Invoice Report"
   Me.Width = 11600
   Me.Height = 9000
   Me.ReportWidth = 8520
   Me.BottomMargin = 1440
   Me.TopMargin = 1440
   Me.LeftMargin = 1440
   Me.RightMargin = 1440
  SetSection6
End Sub
Private Sub SetSection6() 'parent credit
  Sections("Section6").Controls("txtbillno").DataField = "mname"
End Sub

 for other controls place controls and in datafield five the column name in database 
<strong>thats it now run !!!</strong>
票数 2
EN

Stack Overflow用户

发布于 2013-09-02 11:35:10

代码语言:javascript
复制
Private Sub SetSection6()  'parent sales => Group header
Sections("Section1").Controls("text1").DataField = "firmName"
End Sub
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17942932

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档