Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot connect ADO data source to reports
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00695306
Message ID:
00695585
Vues:
13
Bernhart,

Thanks for the info... but this requires a DSN correct? I'm trying to do it without a DSN. Let me know if I read it wrong....

Shawn
>Shawn,
>I connect my data without connection ADO but i use SetLogOnInfo()
>
>Look at code Ci below.
>I hope that this code will be able to help you.
>
> *---------------------------------------------------------------------------------------------------
> *-- Change the data source of a report at runtime.
> PROCEDURE changedataSource
> *------------------------------------------------------------------------------------------------
> LPARAMETERS cNewODBC, cTableName, cNewTableName
>
> *
> * cNewODBC ODBC DSN to use for this run
> * cTableName Name of the table this is to be applied to
> * cNewTableName New name of table if appropriate
> *
> LOCAL nItems, lSuccess
> lSuccess = .F.
> IF VARTYPE(cNewODBC) # 'C' OR VARTYPE(cTableName) # 'C'
> RETURN lSuccess
> ENDIF
> IF EMPTY(cNewTableName)
> cNewTableName = cTableName
> ENDIF
>
>
> *
> * Ensure '.dsn' is not included - also remember the ODBC name is CaSe SeNsItIvE
> *
> cNewODBC = STRTRAN( cNewODBC, '.dsn', '')
>
> WITH THIS.crreport
> nItems = .DATABASE.TABLES.COUNT
>
> FOR nX = 1 TO nItems
> *
> IF UPPER( ALLTRIM( .DATABASE.TABLES.ITEM( nX ).Location ) ) = cTableName
> * WAIT WINDOW "Connection Serveur Ok " TIMEOUT 4
> .DATABASE.TABLES.ITEM( 1 ).SetLogOnInfo(cNewODBC, "", "", "")
> .DATABASE.TABLES.ITEM( 1 ).Location = cNewTableName
> lSuccess = .T.
> EXIT FOR
> ENDIF
> ENDFOR
>
> ENDWITH
>
> RETURN lSuccess
> ENDPROC
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform