crystal report自带vb实例的问题?

yousuf 2003-09-12 11:53:52
下面是crystal report9.0中自带的vb实例ADO connection methods
其中还有两个设计器"crystalReport1"和"dataEnvironment1"
但是运行到cmdADO_Click()时会出错
"实时错误'-2147189571(80047cbd)'未启用创建功能"
同样运行到cmdOLEDB_Click()也出错
"实时错误'-2147189571(80047cbd)'未启用创建功能"
*************************************************************
' Purpose: Demonstrate new methods of adding ADO connections to reports
' (New to Crystal Reports 8.0)
'
' There are two new methods that provide a convenient
' way to add ADO data sources to a report:
' 1.) AddADOCommand takes as parameters an active ADO connection
' and an ADO command object. In this example, a new connection
' is created to a database, and the resulting recordset is assigned
' at runtime to the report
' 2.) AddOLEDBSource takes as parameters the name of an active
' ADO connection and the name of a table that can be accessed
' through that connection. In this example, the connection set
' up through the VB Data Environment is used as a data source.
'
' Both methods can be used with either the VB Data Environment
' or another data source created at runtime.
' Notice in the Crystal Report design environment that there is
' no data source attached to the report at design time.
'
Option Explicit

Dim m_Report As New CrystalReport1

' The ADO connection to the local database.
Dim cnn1 As ADODB.Connection
Dim datcmd1 As ADODB.Command

' *************************************************************
' Demonstrate the use of AddADOCommand by opening an ADO data command,
' adding the data source to the report, and then adding a field
' to the report that uses that data source.
'
Private Sub cmdADO_Click()
Dim fld As FieldObject
Dim strCnn As String

' Open the data connection
Set cnn1 = New ADODB.Connection
strCnn = "Provider=MSDASQL;Persist Security Info=False;Data Source=Xtreme Sample Database 9;Mode=Read"
cnn1.Open strCnn

' Create a new instance of an ADO command object
Set datcmd1 = New ADODB.Command
Set datcmd1.ActiveConnection = cnn1
datcmd1.CommandText = "Customer"
datcmd1.CommandType = adCmdTable

' Add the datasource to the report
m_Report.Database.AddADOCommand cnn1, datcmd1
' Add a new field object to the report and set the field object to use
' the new data source.
Set fld = m_Report.Section3.AddFieldObject("{ado.Customer Name}", 0, 0)
LoadReport
End Sub

' *************************************************************
' Demonstrate the use of AddOLEDBSource by opening an ADO data source,
' adding the data source to the report, and then adding a field
' to the report that uses that data source. In this example, the
' OLEDB source in the VB Data Environment is used
'
Private Sub cmdOLEDB_Click()
Dim fld As FieldObject

' Add the datasource to the report
m_Report.Database.AddOLEDBSource DataEnvironment1.Connection1, "Customer"
' Add a new field object to the report and set the field object to use
' the new data source.
Set fld = m_Report.Section3.AddFieldObject("{Customer.Customer Name}", 0, 0)
LoadReport
End Sub

' *************************************************************
' Load the Report in the viewer
'
Private Sub LoadReport()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = m_Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
cmdOLEDB.Enabled = False
cmdADO.Enabled = False
End Sub

' *************************************************************
Private Sub cmdAbout_Click()
frmAbout.Show vbModal
End Sub

' *************************************************************
Private Sub cmdExit_Click()
Unload Me
End Sub

...全文
42 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yousuf 2003-10-06
  • 打赏
  • 举报
回复
o
yousuf 2003-09-21
  • 打赏
  • 举报
回复
盗版的也有序列号的
sunruping 2003-09-19
  • 打赏
  • 举报
回复
因为是盗版的程序.序列号不正确,没有启用创建功能.
yousuf 2003-09-19
  • 打赏
  • 举报
回复
有没有高手可以搞定
yousuf 2003-09-16
  • 打赏
  • 举报
回复
o
yousuf 2003-09-12
  • 打赏
  • 举报
回复
很无赖
连crystal自带的例子也出错
yousuf 2003-09-12
  • 打赏
  • 举报
回复
crystal report高手们请赐教
yousuf 2003-09-12
  • 打赏
  • 举报
回复
为什么会这样了?
课程介绍:这是一门Java语言入门课程,针对的是Java初学者或者从事其他计算机语言开发但希望转到Java开发工作上来的软件工程师,是所有想入java之门的朋友首先要学的第一门课,也是整个Java开发的核心和基础,也就是大家常说的JAVA SE版本中涵盖的知识;本门课程将采用 windows平台下的intellij IDEA开发环境作为主要的讲解平台,对于熟悉其他Java开发环境的学友们,当然也可以选择自己熟悉的平台;本门课程希望达到的目标是给大家打语言基础,但不希望一上来给大家太重的学习负担,分阶段,逐步的学习,是更好的学习方式,所以在本门课程中,我们将只涉及到基础的语言,以及面向对象程序设计的一些基础概念,更多的知识和概念我们将放在进阶课程中讲解,这一点望大家知晓;在Java诞生的不到30年时间里,Java开发人员的市场需求已经增长到了一个非常惊人的程度,至少目前来看,没有任何一门开发技术能够和java比,从待遇方面,高级Java开发人员的薪资也是相当的高,大概只有c++能够和Java掰一掰手腕,其他的开发技术的薪资待遇,很难与Java比较。很多想学习java的同学,会有一种困惑,感觉Java知识特别零散,除基本的Java语言外,各种概念、各种框架层出不穷,那我们怎么入学习之门,学到什么程度,能找到什么样的工作,这些问题就会困扰着我们;针对这种情况,我将不断推出一系列的Java课程,通过这一系列的课程,为大家搭建一条比较完整的Java学习链条,我并不准备回答大家“学到什么程度,能找到什么样的工作这种问题“,因为当你学到一定的程度之后,你自然就会找到答案,但有一点可以确定:仅仅学习完本门课程还不够,还需要继续深入学习下去!讲解中所安装的是jdk版本是jdk 12版本,但这并不意味着我们要把这个版本中的所有知识讲解的面面俱到,把最有用、最实用,最能帮助大家加薪的知识挑选出来讲解是老师的重要责任;讲师介绍:王健伟老师,网名:狂想(KuangXiang),1995年毕业于哈尔滨工程大学计算机及应用专业,20多年软件开发经验,经历过数十个软件项目开发包括网络通信、网络安全、网络游戏等领域,多年的摸爬滚打使自身具备了极其深厚的开发实力和实战经验。深圳知名网络安全公司安络科技(www.cnns.net)有限公司创始人之一、中国首套网络安全在线扫描评估系统项目负责人,电子工业出版社2003年《Crystal Reports水晶报表设计与开发实务》书籍作者,全球同服独立游戏《冒险之路》制作人。在教学上,老师自带讲课天赋,善于用最清晰、最通俗的语言把复杂问题简单化,让你听了就能懂,当节学完基本就能掌握,老师能够为你节省大量的学习时间并能达到极好的教学效果!

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧