|
-
Jul 28th, 2005, 03:58 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Crystal Report Printing
I had develop a program using VB6 with Crystal Report 8.5 as reporting tools. When I run this piece of code on end-user's platform, I will get error when printing the report. The message appears to be 'Cannot open SQL Server'. But when I open the report designer, and I go to 'Database->Verify Database', then it works, it requires the connection to ODBC. Is there a way to by pass this step? Avoid the pop up error message?
Pls advise.
Thanks.
-
Jul 28th, 2005, 07:49 AM
#2
PowerPoster
Re: Crystal Report Printing
I use this bit of code to run reports. It does the db stuff..
VB Code:
Set Report = crxApplication.OpenReport("Z:\DAD\LotJobDiff.rpt", 1)
For Each crxDatabaseTable In Report.Database.Tables
crxDatabaseTable.ConnectionProperties("user id") = "sa"
crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechniSQL
Next crxDatabaseTable
Report.SelectPrinter glbPrinterDriver, glbPrinterName, glbPrinterPort
Report.PaperOrientation = crDefaultPaperOrientation
If glbPrinterDestination = 0 Then
glbReportForm = "frmPSOutOfSynch"
CRViewer.Show vbModal
Else
Report.PrintOut False
End If
Last edited by Hack; Jul 28th, 2005 at 09:01 AM.
-
Jul 29th, 2005, 01:01 AM
#3
New Member
Re: Crystal Report Printing
Hi,
I guess whatever connection string you are using in your data entry forms just use that connection string for your crystal reports connection. I guess it should work.
-
Aug 5th, 2005, 11:44 PM
#4
Thread Starter
Addicted Member
Re: Crystal Report Printing
Hi Pasvorto
Could you pls post the full code for the process??
I dont quite get your ideas...
Thanks
-
Aug 6th, 2005, 01:30 PM
#5
Re: Crystal Report Printing
You may also need .SetLogonInfo, but I have a couple of examples in my signature for CR.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|