Solved

crystal reports 8, subreports, visual basic 6

Posted on 2004-10-07
7
1,753 Views
Last Modified: 2012-06-27
Hello,

I have a Visual Basic 6 application calling a crystal report version 8 with a subreport. When attempting to invoke the crystal report it errors with "can not open SQL server - 20599." I have other crystal reports without subreports that work fine in the same application. The code is as follows:

Private Sub cmdSummary_Click()
Dim ODBC_String As String

On Error GoTo ErrorHandler
ODBC_String = "DSN=btireports.dsn;DSQ=" & pubstrDatabase & ";UID=bti;PWD=zoe"

crpReports.Connect = ODBC_String

If Me.cboDepartment <> "All" Then
    crpReports.StoredProcParam(0) = Mid(Me.cboDepartment, 1, 7)
Else
    crpReports.StoredProcParam(0) = Me.cboDepartment
End If
crpReports.ReportFileName = pubstrReportLocation & "ConsolidatedDeptDivLevelQuarterly.rpt"
crpReports.Action = 1

GoTo ExitSub

ErrorHandler:
    MsgBox "Printing Summary Report:  " & Err.Description & " Error # " & Err.Number
ExitSub:

End Sub

Any help on why subreports do not work correctly in this context would be greatly appreciated.

Thanks,

Joe
0
Comment
Question by:jcmyers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 10

Accepted Solution

by:
ebolek earned 125 total points
ID: 12253645
You are not setting login info and parameter of the subreports . Check these dicuments out. Thye will solve your problem

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr8_vb_rdc_parameter.exe.asp 
http://support.businessobjects.com/library/kbase/articles/c2003098.asp 

Regards
Emre
0
 
LVL 13

Assisted Solution

by:vidru
vidru earned 125 total points
ID: 12254070
Looks like you're using the OCX, eh?

Try adding this before "crpReports.Action = 1":

crpReports.SubreportToChange("YourSubreportName")
crpReports.Connect = ODBC_String
crpReports.SubreportToChange("")

If you don't have the Help files for the OCX, you can get them here:
http://support.businessobjects.com/communityCS/FilesAndUpdates/SCR_OCX_Help.exe.asp?recDnlReq=Record&dnlPath=SCR_OCX_Help.exe

-dave
0
 
LVL 13

Expert Comment

by:vidru
ID: 12454819
Suggest points to vidru.

-dave
0
 
LVL 10

Expert Comment

by:ebolek
ID: 12462760
Comment from ebolek
Date: 10/07/2004 02:07PM PDT
 explains how to make the runtime customizations that the user asked in vb6 there fore suggest points to ebolek

Thanks
Emre
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question