triphen
asked on
Crystal Reports VB6 Logon
Hello Experts,
I am trying to run a Crystal Report thorugh VB6. Here is my code:
It generates this error:
-------------------------- -
Crystal Report Viewer
-------------------------- -
Logon failed.
Details: 28000:[Sybase][ODBC Driver][SQL Anywhere]Invalid user ID or password [Database Vendor Code: -103 ]
-------------------------- -
OK
-------------------------- -
I don't have any login info within my VB code as you can see. I cant seem to figure out the syntax for the connection string. I have successfully used this connection string in the past to connect.
"Driver={SQL Anywhere 10};Password=password;Pers ist Security Info=True;User ID=user;Data Source=sqlbase;Location=sq lbase"
Any help would be appreciated.
I am trying to run a Crystal Report thorugh VB6. Here is my code:
Dim crxApp As CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\DetailRecpt.rpt")
crxRpt.ParameterFields(1).AddCurrentValue ("44444") 'testing with trans# 44444
CRViewer.ReportSource = crxRpt
CRViewer.ViewReport
It generates this error:
--------------------------
Crystal Report Viewer
--------------------------
Logon failed.
Details: 28000:[Sybase][ODBC Driver][SQL Anywhere]Invalid user ID or password [Database Vendor Code: -103 ]
--------------------------
OK
--------------------------
I don't have any login info within my VB code as you can see. I cant seem to figure out the syntax for the connection string. I have successfully used this connection string in the past to connect.
"Driver={SQL Anywhere 10};Password=password;Pers
Any help would be appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Private Sub SetReportLocation(ByRef RepObj As CRAXDRT.Report)
Dim CrxDDF As CRAXDRT.DatabaseTable
Dim CP As CRAXDRT.ConnectionProperties
For Each CrxDDF In RepObj.Database.Tables
Set CP = CrxDDF.ConnectionProperties
CP.DeleteAll
CP.Add "Connection String", "Driver={SQL Anywhere 10};Password=password;Persist Security Info=True;User ID=user;Data Source=sqlbase;Location=sqlbase"
Next
Set CrxDDF = Nothing
Set CP = Nothing
End Sub
Private Sub Form_Load()
Dim crxApp As CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report
SetReportLocation crxRpt
Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport(App.Path & "\Reports\DetailRecpt.rpt")
crxRpt.ParameterFields(1).AddCurrentValue ("44444") 'testing with trans# 44444
CRViewer.ReportSource = crxRpt
CRViewer.ViewReport
End Sub
Generates:
RunTime error 91
Object variable or With Block variable not set
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks better, different error
-------------------------- -
Crystal Report Viewer
-------------------------- -
Logon failed.
Details: 28000:[Sybase][ODBC Driver][SQL Anywhere]Login mode 'Integrated' not permitted by login_mode setting [Database Vendor Code: -1074 ]
-------------------------- -
OK
-------------------------- -
--------------------------
Crystal Report Viewer
--------------------------
Logon failed.
Details: 28000:[Sybase][ODBC Driver][SQL Anywhere]Login mode 'Integrated' not permitted by login_mode setting [Database Vendor Code: -1074 ]
--------------------------
OK
--------------------------
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CP.Add "ConnectionString", "Driver={SQL Anywhere 10};Uid=user;Pwd=password; DSN=sqlbas e;"
This worked!
This worked!
ASKER
Thanks for your response. The solution I accepted there worked but when I moved the EXE out of my development environment it not generates that logon error. I am sure it's because I dont have any connection string in my code, however I dont know the syntax :/