PLease help. I am using Visual Basic 6 to connect and run a crystal report. I was able to use this exact method at my last job with Crystal 9, and VB6. Still connecting to an ODBC datasource from within the System DSN in Control panel. Version of ORacle is 10g.
The one thing I have noticed that is different is that Crystal 8.5 under the Database menu in crystal references pdsodbc.dll, where as the computer I am using only has p2sodbc.dll on the harddrive. I am not able to choose p2sodbc as a selection in the actual crystal report. Could this be the problem why I get the Server has not yet been opened error?
Here is the code that had worked for me in the past:
References: Crystal Report Viewer, Crystal Reports 8.5 activeX Designer Run time library, other various regular references.
Private Sub Form_Load()
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Dim DB As CRAXDRT.Database
Dim strDBDLL As String 'database connection dll
Dim strDSNName As String 'odbc dsn name
Dim strDBName As String 'database name
Dim strUser As String 'database user
Dim strPwd As String 'database user password
Dim strdate As String
'strdate = Format(Now, "mmmm dd yy") 'Use in naming conventions of saved file, or Email
'Workbooks.Open FileName:="I:\Common\Steve\UserPass.xls", Password:="password"
'strUser = Range("A1").Value
'strPwd = Range("A2").Value
strUser = user
strDBDLL = "P2SODBC.dll"
'strDBDLL = "PDSODBC.DLL"
strDSNName = "My DSNNAME"
strDBName = ""
Set Report = Appl.OpenReport("C:\Crystal Reports\Report1.rpt")
Set DB = Report.Database
DB.SetLogOnServer strDBDLL, strDSNName, strDBName, strUser, strPwd
PLease HELP!!! I have never had this problem before.