本文介绍了数据报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Haai,


nw只有我加入了这里....


我有机会数据报告。 .. mmm ....如何显示最后一条记录frm数据库到数据报告?有人帮我plzzzzz?

Haai,

nw only i''ve joined here....

i''ve prob wit Data report... mmm.... how to show the last record frm Database to the Data Report? anyone help me plzzzzz?

推荐答案



我假设您希望在数据报告上打印数据库的最后一条记录。


您必须拥有一个独特的领域,例如。说empno是独一无二的

现在使用记录集


Myrs.Open" select empno from emp" ,...........

Myrs.MoveLast

''声明变量并将empno存储在其中

Dim Emp为整数

Emp = val(Myrs.Fields(0))


因此,您将最后一个值存储在名为Emp的变量中

现在当你显示报告时尝试

设置m1 = Mycon1.Execute(" select empno,empname from emp where empno ="& Emp&"", ,adCmdText)


注意:我没有使用过数据环境。

退房并看看

I presume you want the last record of the database to be printed on the data report.

you must be having a field that is unique eg. say empno is unique
now use a recordset

Myrs.Open "select empno from emp" ,...........
Myrs.MoveLast
''Declare a variable and store the empno in it
Dim Emp as integer
Emp=val(Myrs.Fields(0))

So you have the last value stored in a variable named Emp
Now when you show the report try
Set m1 = Mycon1.Execute("select empno,empname from emp where empno=" & Emp & "", , adCmdText)

Note: I have not used data environment.
Check out and lets see




问候,Haai!


VB是从通过Pass-Through查询构建的查询表中获取此报告还是表格?


如果来自Pass-Through查询,您可能需要刷新生成表查询以从VB正在查看的原始表中收集新信息...


希望这有帮助,Haai!


D?k?ll

Greetings, Haai!

Is VB getting this report from a queried table built through a Pass-Through query or a table?

If from a Pass-Through query, you may need to refresh your make table query to gather new information from the original table VB is looking at...

Hope this helps, Haai!

D?k?ll



这篇关于数据报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 11:00