Wednesday, March 21, 2012

Run Time Database Connection

Hi
I 've created dsn for sqlserver during run time but while connecting with crystalreport it gives ODBC Error . I need to connect using CRAXDRT.Report,CRAXDRT.Application ,I'm Using vb as front end
Thanks In AdvGenerall the errors are descriptive, so please provide details on which ODBC error it is.

Dave
(Me.HomeTown = DarrenLehmann.HomeTown)
Go Aussies.|||Hi Spring soft

I solved my problem thanx for ur post|||Hi Tony,
Perhaps you could let us know the solution, for enlightenment of others.
On reflection, I suspect the report had a subreport. That's the most common reason (apart from improperly structured formulae) that raises ODBC errors.

Dave|||Ofcourse dave

Private m_crxApp As New CRAXDRT.Application
Private m_crxRep As CRAXDRT.Report
Attribute m_crxRep.VB_VarHelpID = -1
Private m_crxTab As CRAXDRT.DatabaseTable
Implements clsSimpleReport
Public Function clsSimpleReport_RunReport(sReportFileName As String, sTitle As String) As Variant
Dim i As Integer, j As Integer
On Error Resume Next
Screen.MousePointer = 11
m_crxApp.LogOnServer "p2sodbc.dll", "DSN", "DBNAME, "UID", "PWD"
Set m_crxRep = m_crxApp.OpenReport(App.Path & "\Reports\" & sReportFileName)
crvReport.ReportSource = m_crxRep
crvReport.ViewReport
End sub

My mistake was instead of p2sodbc.dll in logon server function i put some other dll file i'm not remembering that nowsql

No comments:

Post a Comment