Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET Crystal Reports Oracle 9 and 8.i "Unable to Connect : incorrect log on parameters."

Status
Not open for further replies.

Kittyjs1

Programmer
May 11, 2009
1
US
I am new with Crystal and VB.net. I have code in place to export my report. I need to go between two Oracle DB's. One 9 the other 8.i. When I get to the export statement I get "Unable to Connect : incorrect log on parameters." I have seen people with the same issue but have not seen any solutions. Is there a better way to do this?

Any help would be greatly appreciated.

Thanks,
Jackie

Select Case myReportName
Case "Affidavit"
'Dim crReport As New Affidavit
crReport = New Affidavit
crReport.SetParameterValue("HSN", xHSN)
Case Else
Exit Sub
End Select

Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions
CrExportOptions = crReport.ExportOptions
Dim exFileName As String
Select Case ExportFormat
Case "PDF"
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions
CrFormatTypeOptions.FirstPageNumber = 1
CrFormatTypeOptions.LastPageNumber = 1
CrFormatTypeOptions.UsePageRange = True
CrDiskFileDestinationOptions.DiskFileName = "c:\Temp1\" & xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".pdf"
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
End With
Case "XLS"
exFileName = xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".xls"
CrDiskFileDestinationOptions.DiskFileName = "c:\Temp1\" & xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".xls"
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.Excel
.DestinationOptions = CrDiskFileDestinationOptions
End With
Case "DOC"
exFileName = xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".doc"
CrDiskFileDestinationOptions.DiskFileName = "c:\Temp1\" & xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".doc"
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.WordForWindows
.DestinationOptions = CrDiskFileDestinationOptions
End With
Case "RTF"
exFileName = xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".rtf"
CrDiskFileDestinationOptions.DiskFileName = "c:\Temp1\" & xHSN & "_" & Format(Now, "yyyymmddhhmm") & ".rtf"
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.RichText
.DestinationOptions = CrDiskFileDestinationOptions
End With
End Select

Dim I As Integer
Dim TBL1 As New CrystalDecisions.Shared.TableLogOnInfo

TBL1.ConnectionInfo.ServerName = DB

'TBL1.ConnectionInfo.DatabaseName = DB

TBL1.ConnectionInfo.Password = "apples"

TBL1.ConnectionInfo.UserID = DB

For I = 0 To crReport.Database.Tables.Count - 1
crReport.Database.Tables(I).ApplyLogOnInfo(TBL1)
Next I

crReport.Export()
 

I think you might have better luck with this question in one of the Crystal Reports forums:

forum767

forum766

forum768

forum149

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top