Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing connection string
Message
 
To
19/05/2006 18:30:42
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
01123703
Message ID:
01123705
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform