Solved

Error '20527'

Posted on 1998-11-15
1
1,857 Views
Last Modified: 2013-12-25
Hi all,
    I'm having this problem.  When I print from my VB application to Crystal Reports, I get this error message..

"SQL Server Error '20527'"

    Any idea as to what's causing this?  Thanks!

    Puay Aun
0
Comment
Question by:palim
1 Comment
 

Accepted Solution

by:
toophar earned 10 total points
Comment Utility
Essentially it means the reports engine has not been able to open the database. Here's the detailed answer courtesy of seagate:

This error message is connected to using CRPE.DLL in an application, either through PELogonServer call, PESetNthTableLogonInfo call or the Connect property of the CRYSTAL.VBX.

The error occurs only in reports that read off SQL or ODBC databases. and is usually a result of a problem connecting to the datasource, or retrieving records from the database.

Common Reasons for SQL Server Error
Logon parameters
Incorrect Logon Parameters
Ensure that the ServerName, DatabaseName and UserId and Password are all valid for the server that you are trying to logon to. Crystal Reports stores a default ServerName, DatabaseName & UserId in the report. If you leave these blank when coding, Crystal will use the values stored in the report to try to logon. NOTE: A password must also be specified..

The best example of what Crystal is expecting in these members is shown under the Database / Set Location option. The ServerName or DSN corresponds to 'Server Name', the Database Name or DSQ corresponds to 'Database', and the UserId or UID corresponds to 'UserId'. If you're connecting via ODBC, ServerName refers to the ODBC datasource name, not to the path/address of the server, or the server alias.

LogonInfo parameters are not NULL terminated
The members of the logonInfo structure need to be NULL terminated. This issue can arise when you use PE calls in Visual Basic where strings are not automatically NULL terminated. To NULL terminate strings in VB, append a CHR$(0) to the string.

Incorrect StructSize given for LogonInfo structure
One of the members of the PELogonInfo structure, is StructSize. If an incorrect value is given here, a SQL Server error may result. The correct value for the StructSize is 514.

Database driver DLLs cannot be found
If you are using any of the Crystal Reports drivers to connect, refer to the Runtime Files document for a list of the files for the driver.

Wrong database DLL being loaded
If an older version of the database DLL (PDS*.DLL) is loaded, a SQL Server error can result. Use utility programs like DSX.EXE or WPS.EXE to check the DLL being loaded into memory when running the report from the app.

Datasource not found
The ODBC datasource used to log on when creating the report is not installed on the machine that is running the report. To find out what ODBC datasource is used in a particular report, select Database / Set Location in Crystal Reports while the report is open and 'Server Name' will indicate the datasource name.

Now on the machine that gets the error, run ODBC Admin, or open the file \WINDOWS\ODBC.INI and check if a datasource with exactly the same name as the one used in the report exists as an installed ODBC datasource.

For Crystal Reports version 4.0 or higher, the Q+E drivers that ship with Crystal Reports now all connect via ODBC. The error can result if the datasource used by the Q+E driver has not been installed. The following are the datasources that those drivers connect to:

SQL Server/Sybase SQL CRSS
Oracle SQL CRORA
Netware SQL CRXQL
Gupta SQLBase CRGUP
DB2/2 SQL CRDBM
 

Interface drivers cannot be loaded
ODBC drivers do not normally connect directly to the database, but connect via some client server interface. Examples of these are DBLibrary for SQL Server, CTLibrary for Sybase and SQL*Net for Oracle. Make sure the directory where the interface driver resides is included in the path. If the server interface has not been installed or has been installed incorrectly it will result in this error.

Incorrect SQL statement
The SQL statement of a report can be modified using the SQLQuery property or the PESetSQLQuery function, and a wrong SQL statement will cause this error. When modifying a SQL statement that contains an 'ORDER BY' clause, make sure there's a line feed and a carriage return character before 'ORDER BY'. The last character in the 'FROM' clause gets truncated without these.

Missing INI file
When reporting off text files via ODBC, make sure the file QETXT.INI (or SCHEMA.INI depending on the driver) exists in the directory where the text files are located.

The error can also be a result of a problem on the server side and you can usually get a better error message by adding the following line into CRW.INI found in the Windows directory.

DebugMode=Yes

When using version 4.0.1.5 or higher, open the report in Crystal Reports and select the 'More Print Engine Error Messages' option under File / Report Options. Re-save the report.

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now