I added this code as a procedure to change the database, but it doesn't work.
Continue reading the database that is in the original connection

put the procedure in OnInitializeReport.
Where should I place it? is the code wrong?


Code:
 Procedure DFReporteCambiaBDatos  Global                                     
     String sDatabaseConnection
      Get psDatabaseConnection  C_USEMAINDRREPORTID to sDatabaseConnection //of oReport  
      If (gsDefaultBD<>"")  Begin 
               Move (Replace("MFxxxxxxx",sDatabaseConnection,gsDefaultBD)) to sDatabaseConnection //gsDefaultBD
               Set psDatabaseConnection  C_USEMAINDRREPORTID to sDatabaseConnection //of oReport
      End  
  End_Procedure
Edgar