Saturday, February 25, 2012
Connection Error
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 !
Friday, February 10, 2012
Connecting to SQL Server 2k5 Dev Edition
Are there any other settings that I should look at? I'm working a bit in the dark here.
Thank you,
NoelHi Noel,
So I understand the problem you're experiencing, let me restate the problem. :)
On SERVER, which is Windows Server 2003 SP1, you have SQL 2005 Dev RTM.
On LOCAL, which is Windows XP SP2, you also have SQL 2005 Dev RTM.
When you say you "cannot see" SERVER from LOCAL or LOCAL from SERVER, what do you mean? Can you PING LOCAL from SERVER and vice versa by name? by IP?
Did you run the Surface Area Configurator on both machines and ensure Local + Remote access was enabled? After enabling TCP\IP and Named Pipes on LOCAL, did you stop and restart the service (this has to be done for the service to start listening on those protocols)?
jeff.|||Also, if your instance name is a named instance you'll need to start the SQL Browser service. If the Windows Firewall is enabled you'll need to add exceptions for sqlservr.exe and sqlbrowser.exe. To find the path to the correct SQL Server executable check out the "Path to executable" in the Windows Service Control Manager for the SQL Server service.
This blog for SQL Server Express is also relevant for Dev edition: http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
Dan