Hi ! rajan,
Could u please tell me how to connect to crystal report 8.5 to sql server from visual basic 6.0.
Printable View
Hi ! rajan,
Could u please tell me how to connect to crystal report 8.5 to sql server from visual basic 6.0.
This is how I connect CR9 to SQL Server 2000:
VB Code:
Dim PRINTREPLY As VbMsgBoxResult PRINTREPLY = MsgBox("Print to screen?", vbYesNo) If PRINTREPLY = vbNo Then glbPrinterDestination = 1 ' CommonDialog1.ShowPrinter Else glbPrinterDestination = 0 End If --The above code sets a flag for either printing or using the viewer Set Report = crxApplication.OpenReport("Z:\DAD\MachineUsage.rpt", 1) For Each crxDatabaseTable In Report.Database.Tables crxDatabaseTable.ConnectionProperties("user id") = "sa" crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechniSQL Next crxDatabaseTable Report.PaperOrientation = crDefaultPaperOrientation If glbPrinterDestination = 0 Then glbReportForm = "frmProduction" CRViewer.Show 1 Else Report.PrintOut False End If
Edit: Fixed [vbcode][/vbcode] tags. - Hack
Split from this thread.