See

Showing posts with label RunTime ConnectionString DataEnvironment. Show all posts
Showing posts with label RunTime ConnectionString DataEnvironment. Show all posts

Tuesday, November 20, 2007

Changing Connection String of DataEnvironment at runtime

Changing Connection String of DataEnvironment at runtime


If DataEnvironment1.Connection1.State = adStateOpen Then
DataEnvironment1.Connection1.Close
Else

DataEnvironment1.Connection1.ConnectionString = strConnString
DataEnvironment1.Connection1.Open
End If

strConnString= Data Provider=SQLOLEDB;Data Source=ServerAddress;Initial Catalog=DataBase;User ID=Username;Password=Password;

it will work when u r using single command but when u will use child command . it will show error to solve it u have change ur connection string by adding Data Shape as given below. Data Shape is used for relational database in report design.

strConnString= Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=erverAddress;Initial Catalog=DataBase;User ID=Username;Password=Password;