Saturday, February 25, 2012

Connection Error

Hi friends ! , you may help me with this...

I have a report made with CR 8.0 that I call from VB6 application with a CrystalReport Control. When I execute myCrystalReport.Action = 0, an error raises: error number 20536, description: not possible to begin session in the server.
The report takes the data from a table in a Sql Server.

This is the code:

CR.ReportFileName = gstrPathReports & "\People.rpt"
CR.Action = 0

I also tried with:

CR.LogOnServer "P2SSQL.DLL", gstrCfgServerName & "\" & gstrCfgInstanceName, _
gstrCfgDBName, "sa", "hello"

but it still odesn't work...

Thanks for your help !Hi try the following
CR.ReportFileName = gstrPathReports & "\People.rpt"
CR.Action = 1
Madhivanan|||Now it says: "Cannot open the sql server"

Any other idea?

By the way, what's the difference between 0 and 1 in the Action?

Thanks !!!|||so its the problem of connection..not the printing.
Have you tried showing the report like Report.Show without passing the parameters for printing?
The problem with the connection may be due that, you are not passing correct user name and password in the parameters.
And secondly that the report ypu are not setting database location.

You can check for parameters in the sql server profiler, if the query is fine and checking the query in the query analyzer.|||My CrystalReport control doesn't have the Show method...

The password and username are ok, and the database location is also ok, because when I open the report from Seagate Crystal Report 8.0 it works fine.

The report doesn't have parameters, because it just shows columns from a table.

That's why I tried with LogOnServer, because the problem seems to be that I can't open the connection from the VB6 application when I invoke the report, but still doesn't work...

Thank you for any ideas !|||does your report have subreports?|||No, it doesn't...|||Hi vbUsername, check whether gstrCfgServerName & "\" & gstrCfgInstanceName gives correct server name that you are using.

Madhivanan|||Yes, they are ok, as well as the DBName, UID and PWD...

Thank you for your concern !
I just cannot make it work, and it's such a simple report !

No comments:

Post a Comment