VB 6.0 - Error no. 20534 - Asked By Prakash Thirumoorthy on 24-Nov-08 01:51 AM

Hi to all,

        I am using VB and Crystal Reports with back end MySQL. I have done successfully all dll's and i could call the report. but i could not show the report, i got the error no. 20534 that says "Error Detected by Database dll". anyone say he answer.




Read this - ram kumar replied to Prakash Thirumoorthy on 24-Nov-08 01:56 AM


you can use modules to compare the dlls that are loaded on the target before a vb 6 install (when the error comes up) and after the install (when it works fine)



re - Web Star replied to Prakash Thirumoorthy on 24-Nov-08 02:10 AM



Re :: Error No. 20534 - SP replied to Prakash Thirumoorthy on 24-Nov-08 02:25 AM


Err Msg: "20534: Error detected by database DLL" with Visual Basic 6 SP3

The information in the article refers to:
Crystal Reports 8.5
Applies to:
Reported version and lower
Crystal ActiveX (OCX) Control
ODBC connection to a text file
Error "20534: Error detected by database DLL"

A Microsoft Visual Basic application uses the Crystal Reports OCX control (crystl32.ocx) as the reporting development tool.

A Crystal Report is created using Microsoft's ODBC driver for text files. When attempting to preview the report in Microsoft Visual Basic, the following error message appears:

Run-time error "20534: Error detected by database DLL"

Using ODBC Trace generates the error:

Run time error '-2147467259 (80004005)': [Microsoft][ODBC Text Driver] Selected collating sequence not supported by the operating system

The report previews successfully in the Crystal Reports designer and when the project is compiled into an executable.

Similar errors occur with other Crystal Reports Development tools:

- The Automation Server (cpeaut32.dll) displays the same error.
- The Print Engine API (crpe32.dll) displays error "534: Error detected by database DLL"
- The Report Designer Component displays the error "Selected collating sequence not supported by the operating system" (see Knowledge Base article c2007927 for further details).


This is a known issue within the Microsoft Visual Basic Service Pack 3 and higher. For more information on this issue refer to Microsoft Knowledge Base article Q246167 at http://support.microsoft.com/
To run the project in the Visual Basic IDE, use the following error trapping code:

#Const fDebug = true
Dim logon as integer

On Error GoTo traperror:

With CrystalReport1
.ReportFileName = <path to report file>
logon = .LogOnServer("pdsodbc.dll","<Your DSN>","","","")
.Action = 1
End With


#If fDebug = true then
         If Err.Number = 20534 Then
CrystalReport1.Action = 1
         End If
#End If

The error trapping code is only run if the fDebug variable is set to True. Before compiling your application to distribute to users, set fDebug to False. Your application will then not run the debugging code in the compiled executable.

Hope this helps.