Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 1677
Number of posts: 4766

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Need help with VB6 programming Posted by rezakhandaker on 26 Feb 2010 at 11:49 AM
Hello everyone,
I'm a novice programmer trying to display Crystal Report 8.5 report (C:\Try.rpt) through my VB6 program. It is to be mentioned that the database that I'm useing is Oracle 9i installed on the same computer and Global Database Name/SID is 'exim'. I'm using the following code -
**********************************************************************
Public cn As New ADODB.Connection
Public rs As New ADODB.Recordset
Public CnString As String
Public SQLSelect As String
Public crxApp As New CRAXDRT.Application
Public crxReport As CRAXDRT.Report

Private Sub Form_Load()
Call OpenDatabase
Call LoadReport
End Sub

Public Function LoadReport()
Set crxReport = New CRAXDRT.Report
Set crxApp = CreateObject("crystalruntime.application")
Set crxReport = crxApplication.OpenReport("C:\Try.rpt", 1)
crxReport.DiscardSavedData
crxReport.Database.SetDataSource rs
crvViewer.ReportSource = crxReport
crvViewer.ViewReport
End Function

Public Function OpenDatabase()
Set cn = New ADODB.Connection
CnString = "Provider=MSDAORA.1;Persist Security Info=True;User ID=scott;Password=tiger;Initial Catalog=GR;Data Source=exim"
cn.ConnectionString = CnString
cn.Open
cn.CursorLocation = adUseClient
SQLSelect = "SELECT * FROM EMP_VIEW"
rs.Open SQLSelect, cn, adOpenDynamic, adLockReadOnly
End Function
**********************************************************************************

When I'm trying to run this program, I'm getting an error message - "Run-time error '-2147217887 (80040e21)': Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."

Can anyone please check my codings and help me to rectify the problem. I'll be glad if someone can email me at rezakhandaker@yahoo.com with the solution to this problem. Thanks in advance.

With best regards

Reza Khandaker
4/4, Golden Tower, Golden Street,
Ring Road, Shyamoli,
Dhaka - 1207
Cell: 01730-031453
Report
Re: Need help with VB6 programming Posted by ema123 on 4 Mar 2010 at 9:50 PM
This is a wonderful article. The things given are unanimous and needs to be appreciated by everyone.
================
Ema

Debt Management



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.