在2012年12月31日之后以vb6打印报告 [英] Printing reports in vb6 after 31-12-2012

查看:73
本文介绍了在2012年12月31日之后以vb6打印报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们

你们都好。首先,祝大家新年快乐,新年快乐。

朋友

我的项目实际上是在vb6中打印报告并且很好地访问到2012年12月31日。但是现在我在特定日期保存在数据库中的所有记录都没有在当天的报告中通过在VB6中使用Datetime Picker来显示。

实际上,当我使用Do While Not rs.EOF代码时,它总是成真并且控制转到循环外的代码。

我想使用任何格式的dtpicker日期,以便我的报告得到结果



代码如下。

连接
sql = 患者
设置 rs = ADODB.Recordset

rs.Open 从患者中选择*,其中日期介于#& DTPicker1.Value& #AND#& DTPicker2.Value& ,Con,adOpenDynamic,adLockPessimistic

Dim X As 整数
执行 rs.EOF

X = X + rs.Fields( 9 )。值' 此处字段9实际上是费率字段

rs.MoveNext
循环

DataReport1.Sections( Section5)。控件( label17)。Caption = X
设置 DataReport1.DataSource = rs
DataReport1.Show vbModal







另外我已将格式化数据时间选择器值格式化为

 DTPicker1.Value =格式(现在,  DD-MM-YYYY
DTPicker2.Value =格式(现在, DD-MM-YYYY

解决方案

鉴于VB6在十年前已经过时,也许那里的日期时间选择器不能超过2012年?我希望如此,那粗话将最终死亡。



您是否已调试以查看正在传递的值?


亲爱的朋友

我使用了以下查询,我认为这解决了问题。

连接
sql = < span class =code-string> 患者
设置 rs = ADODB.Recordset

' rs。打开从患者中选择*,其中日期介于#& DTPicker1.Value& #AND#& DTPicker2.Value& #,Con,adOpenDynamic,adLockPessimistic
rs.Open 从患者中选择*日期介于#&格式


(DTPicker1.Value, mm / dd / yyyy)& #AND#&格式

Dear friends
How are you all.First of all a very happy and prosperous new year to all of you.
Friends
My project was actually printing reports in vb6 and access nicely till 31 of December 2012. But now all the records i am saving in the database on a particular day is not being shown in the reports on that day by using Datetime Picker in VB6.
Actually when i use the Do While Not rs.EOF code it always comes true and control goes to the code outside while loop.
I want to use dtpicker using any format of date so that my reports gets the result

The code is as under.

Connection
sql = "patients"
Set rs = New ADODB.Recordset

rs.Open "select * from patients where date between #" & DTPicker1.Value & "# AND #" & DTPicker2.Value & "# ", Con, adOpenDynamic, adLockPessimistic

        Dim X As Integer
Do While Not rs.EOF

  X = X + rs.Fields(9).Value ' here field 9 is actually the rate field

  rs.MoveNext
Loop

   DataReport1.Sections("Section5").Controls("label17").Caption = X
        Set DataReport1.DataSource = rs
        DataReport1.Show vbModal




Also i have formated the datatime picker value as under

DTPicker1.Value = Format(Now, "DD-MM-YYYY")
DTPicker2.Value = Format(Now, "DD-MM-YYYY")

解决方案

Given that VB6 was obsolete a decade ago, perhaps the date time picker in there can''t go past 2012 ? I hope so, then that foul language will finally die.

Have you debugged to see what value is being passed through ?


Dear friends
I have used the following query and i think that has solved the problem.

Connection
sql = "patients"
Set rs = New ADODB.Recordset

'rs.Open "select * from patients where date between #" & DTPicker1.Value & "# AND #" & DTPicker2.Value & "# ", Con, adOpenDynamic, adLockPessimistic
rs.Open "select * from patients where date between #" & Format


(DTPicker1.Value, "mm/dd/yyyy") & "# AND #" & Format


这篇关于在2012年12月31日之后以vb6打印报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆