我想打印收据,但我遇到了问题(I want to print a reciept but i face a problem)

   IT问题网   2021-02-22 00:00:00

问 题

在这个项目中,我使用datareport和dataenvironment打印收据。



请检查以下代码



 私有  sub  cmdprint_click()
' 设置rpt =新adodb.recordset
' rpt.open"select * from reception_detail where id ="amp; val(txtid.text),con,adopenstatic,adlockoptimistic,adcmdtext

dataenvironment1.commands( 1 )。commandtext = " 选择id,patient_name,patient_age,referredby,test,来自reception_detail的金额,其中id ="amp; val(txtid.text)
rptreciept.printreport
rptreciept.show
end sub






当我点击打印命令时,它显示以下错误



运行时错误''5'':lt; br /> 
lt; br />
无效的程序调用或参数




当我点击调试时它突出显示以下行



dataenvironment1.commands(1).commandtext ="select id,patient_name,patient_age,referedby,test,amount from reception_detail where id ="amp; val(txtid.text)

解决方案

你的主要问题是vb6。

不要!



获得vb.net,除了支持vb6之外,与vb6不同,还有更多的功能。





至于你的代码,是否已在本节之前做出所有声明?

命令是否为数组?

很难说明,但是尝试分阶段检查。放一个断点,然后看看



dataenvironment1 - 它有效吗?

dataenvironment1.commands - 好吗?

dataenvironment1.commands(1 ) - 这是可能是问题。

dataenvironment1.commands(1).commandtext - 应该没问题。



如果所有这些都看起来不错,请检查txtid中的值,然后检查txtid.text。

标签:我想打印收据遇到问题



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

Visual Studio 2010 + Windows 7 + 64位计算机+ C ++ + 32位DLLS = 3个问题(Visual Studio 2010 + Windows 7 + 64-bit computer + C++ + 32 bit DLLS = 3 problems)

problem i''ve been using visual studio 2005 for many year ...

什么是Eclipse以及如何使用它?(What is about Eclipse and how to use it)

problem how to use it .and for what purpose it is used so ...

如何从数据库中检索数据?(how to retrieve data from database)

problem i have a radiobuttonlist control and i want to re ...

使用SQL Management Studio将数据插入我的数据库时执行NonQuery(ExecuteNonQuery while inserting the data into my database using SQL Management Studio)

problem hi i have a problem while inserting the data int ...

我如何将C#.Net中的拖放图像转换为ASP.Net(how do i convert Drag and drop image in C#.Net to ASP.Net)

problem hi, i saw the drag and drop image in c#.net arti ...

如何禁用浏览器的后退按钮(How to disable browser's back button)

problem hello friend, i am using asp.net framework 3.5,i ...

滚动后无法打印文本....(Unable to print text after scrolling....)

problem hi, i have written a small c program ...

我使用radgrid,我从数据库获取列名,但我希望他们的名称作为不同的名称,如何重命名RadGrid的列名(Im using a radgrid ,i get column names from database but i want their names as diferent names,How to rename those columns names of RadGrid)

problem im using a radgrid ,i get column names from datab ...

用于showbits函数的头文件(header file to be used for showbits function)

problem which header file shd be used for showbits() func ...

在gridview控件中删除事件行。(Row Deleting event in gridview control.)

problem i am trying to delete userid and groupid from the ...

如何查看.dll文件中编写的代码?(how to view code written in .dll file)

problem hi to all.i have downloaded source co ...

登录 - 使用哈希值检查密码(login - check password with hashed one)

problem this is my code to hash class hashin ...

上传图片时出现问题(problem in uploading images)

problem i want to upload images that will be saved in a f ...

如何使用c#向Bixolon热敏打印机发送命令(How to Send commands to Bixolon thermal printer using c#)

problem first of all , i have searched on goo ...

图像波动问题(image fluctuation problem)

problem i want to know how to remove image fluctuate from ...

LISTVIEW每行的随机ID(LISTVIEW random id for each row)

problem hi, all i want is to generate an id ...

如何创建自定义Web控件......?(How to create a custome web control...)

problem 1) i want to create a class that will inherited f ...

如何管理该代码(how to manage that code)

problem my question is......... we have 3 buttns on page ...

如何删除sysobjects中的列数据但不删除它们的关系(how to delete columns data in sysobjects but not deleted their relations)

problem hello how to delete all system table columns dat ...

异步wcf调用和mantaining会话?(asynchronous wcf call and mantaining session )

problem i have two pages on my website .from page 1 i am ...