Solved

Error '20527'

Posted on 1998-11-15
1
1,892 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
ID: 1497652
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

18 Experts available now in Live!

Get 1:1 Help Now