Consultor Eletrônico



Kbase P12384: Error 5890 when using Crystal Report automation object
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/10/2003
Status: Unverified

FACT(s) (Environment):

MERANT 3.60 32-BIT Progress SQL-92

FACT(s) (Environment):

Progress 9.1x

SYMPTOM(s):

Error 5890 when creating Crystal Report automation object

Error occurred while accessing component property/method: Action.
Cannot find SQL server.
Error: 0x80020009 USER-INTERFACE-TRIGGER (5890)

Error occurred while accessing component property/method: Preview.
Cannot find SQL server.
Error: 0x80020009 USER-INTERFACE-TRIGGER (5890)

Unable to set com-handle property. (5677)

Using Crystal Report 6

CHANGE:

Changed report's ODBC Data Source in the Crystal Report Designer

CAUSE:

Crystal Report automation object didn't pick the updated value for the ODBC Data Source defined for the opened report.

FIX:

Remove the old ODBC DataSource using the "Data Sources (ODBC)" tool (or "ODBC Data Administrator"), open the report in the Crystal Report Designer again and when prompted for the new DataSource, choose the correct one and save the report.

This is the 4GL procedure that might be used to validate the data stored in the report:

/* ************************************************** */
  DEF VAR hCR        AS
COM-HANDLE NO-UNDO.
  DEF VAR hReport    AS COM-HANDLE NO-UNDO.
  DEF VAR hDB        AS
COM-HANDLE NO-UNDO.
  DEF VAR chTables   AS COM-HANDLE NO-UNDO.
  DEF VAR chTable    AS COM-HANDLE NO-UNDO.
  DEF VAR iCount     AS INTEGER   
NO-UNDO.
  DEF VAR i         
AS INTEGER    NO-UNDO.
  DEF VAR lret       AS LOGICAL   
NO-UNDO.
  CREATE "Crystal.CRPE.Application" hCR.
  /* Here you can change the path to your report */
  hreport = hCR:openReport("Customer.rpt").
  hDb = hReport:DATABASE.
  chTables = hDb:Tables .
  iCount = chTables:Count .
  DO i = 1 TO iCount :
      chTable = chTables:ITEM(i).
      MESSAGE
          "Table name:     
" chTable:Name    SKIP(1)
          "DescriptiveName:
" chTable:DescriptiveName   SKIP
          "DllName:        
" chTable:DllName          
SKIP
          "LogOnDatabaseName:
" chTable:LogOnDatabaseName SKIP
          "LogOnServerName:
" chTable:LogOnServerName   SKIP
          "LogOnUserID:    
" chTable:LogOnUserID       SKIP
          "SessionUserID:  
" chTable:SessionUserID     SKIP
      VIEW-AS ALERT-BOX INFO BUTTONS OK.
      RELEASE OBJECT chTable NO-ERROR.
  END.
 
  chTable = chTables:ITEM(1).
  NO-RETURN-VALUE chTable:setLogOnInfo(
      "S2k", /* change to your ODBC DataSource
Name */
      "s2k", /* Same as above */
      "skraljev", /* change to your UserID
*/
      "").   /* change to your
Password */
 
  MESSAGE
          "Table name:     
" chTable:Name    SKIP(1)
          "DescriptiveName:
" chTable:DescriptiveName   SKIP
          "DllName:        
" chTable:DllName          
SKIP
          "LogOnDatabaseName:
" chTable:LogOnDatabaseName SKIP
          "LogOnServerName:
" chTable:LogOnServerName   SKIP
          "LogOnUserID:    
" chTable:LogOnUserID       SKIP
          "SessionUserID:  
" chTable:SessionUserID     SKIP
      VIEW-AS ALERT-BOX INFO BUTTONS OK.
 
  lRet = chTable:TestConnectivity().
  MESSAGE "Test Connectivity:" lRet
      VIEW-AS ALERT-BOX INFO BUTTONS OK.
 
  /*                     
*/
  /*  View the report     */
  /*                     
*/
  hReport:preview().
 
  /*    If any change                      
*/
  /*    Update the report automatically    
*/
  /*                                       
*/
  hDb = hReport:DATABASE.
  hDb:verify().
  /*PAUSE .*/
  RELEASE OBJECT chTables NO-ERROR.
  RELEASE OBJECT chTable NO-ERROR.
  RELEASE OBJECT hDB NO-ERROR.
  RELEASE OBJECT hReport NO-ERROR.
  RELEASE OBJECT hCr NO-ERROR.