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

...全文
43 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
  • 打赏
  • 举报
回复
为什么会这样了?
主要功能 人事管理是所有工厂、公司、企事业单位所必须的,它包括人事档案的统计、查询、更新、打印输出等。如果这些工作由人工统计,则工作量很大,若公司人数有几万甚至几十万,人工统计将变得不可想象,用计算机统计可使人们从繁重的劳动中解脱出来,仅一些简单的操作便可及时、准确地获得需要的信息。 企业人事管理系统是现代企事业单位管理人员、工资、日常考勤所必须拥有的信息化管理系统之一,它包括人事信息的增、删、改、查,人员调动、人员离职,人事信息的打印输出,日常考勤管理、工资管理和福利管理等, 操作注意事项 (1)管理员用户名为tsoft,密码为111。 (2)运行本系统还需要在计算机上安装Crystal Report 10,本软件可到官方网站下载,安装方法同安装一般的应用软件一样,这里就不介绍了。 (3)运行本实例前,应将在“控制面板”下的“区域和语言选项”窗口中,将时间格式设为“HH:mm:ss”样式,日期格式为“yyyy-MM-dd”样式。 (4)以上操作都成功完成以后,如果在程序启动时仍然无法进入系统。可以尝试下列解决方法: 在SQL Server2000企业管理器中,展开SQL Server服务器组,在“Local服务器”上单击鼠标右键选择“属性”,然后在弹出的“属性(配置)”对话框中选择“安全性”选项卡,在此选项卡的“身份验证”标签处,选择“SQL Server和Windows(S)”单选按钮,最后单击“确定”按钮完成设置。 业务流程 要想使用本系统,请按照以下流程操作: (1)首先通过“部门管理”/“添加部门信息”模块添加部门信息, (2)通过“人事管理”/“添加员工信息”模块,添加员工信息。 (3)通过“考勤管理”菜单中的功能模块,可设置员工的上下班时间及请假记录。 (4)通过“福利管理”/“添加福利信息”模块,添加员工的养老保险、失业保险及医疗保险金额,此金额将在基本工资中扣除。 (5)通过“工资管理”/“工资信息管理”模块,计算员工工资信息。 (6)通过“工资管理”/“过期数据处理”模块,可按月份清除当前工资信息表中的工资记录。 (7)通过“工资管理”/“工资导出”/“导出Excel”命令,可将工资信息导出到Excel表中。 (8)通过“人事信息统计”菜单中的功能模块,可以报表的形式统计当前员工的年龄、文化程度、工资信息等。

809

社区成员

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

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