Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing connection string
Message
 
À
19/05/2006 18:30:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
01123703
Message ID:
01123705
Vues:
16
Gary,
You didn't specify which version of Crystal you are using so this may or may not work. This was what we use for Crystal 9.0:
	*	Loop through each table in the report and set the connection settings
	*	to the proper database.
	FOR lnCounter = 1 TO loReport.Database.Tables.Count
		WITH loReport.Database.Tables(lnCounter).ConnectionProperties
			*	Save the current table name
			lcLocation = loReport.Database.Tables(lnCounter).Location
		
			*	Clear the current connection properties
			.DeleteAll()

			*	Set the individual values from the connection string
			.Add('Provider',		lcProvider)
			.Add('Data Source',		lcDataSource)
			.Add('Initial Catalog',	lcInitCatalog)
			.Add('Password',		lcPassword)
			.Add('User ID',			lcUserId)
			
			*	Reset the table location
			loReport.Database.Tables(lnCounter).Location = lcLocation
		ENDWITH
	ENDFOR
Kurt

>I have a vfp 6.0 app that uses the crystal viewer.
>I am having trouble with the report logging into the SQL server
>Does anyone have an example of passing a connection string(dsn,userid,password) to the report object prior to viewing.
>
>
>
>Thanks in advance
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform