Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a QVW file which is currently built against the Development Server of Sql Server,And i have plenty of those.Is there anyway that the DataSource inside the Connection String can be changed from Dev to prod while moving these QVD's into Prod environment rather than editing the script task each and every time and chaging the DataSource?
Thanks,
Sujith.
Sorry Sujith, I made a mistake, you need to write the entire connection string into the text file.
I believe the best practice for this is to use an external text file and include that file into your code.
That way you can just change the text file in production but you don't need to change the QVW everytime you move it to production.
Let's do this over here, it might help someone else.
Create a text file, call it config.txt
Write the following into the file
let vDATASOURCE = 'yourdevelopmentdatasource';
Then your QVW code will be
$(Include=config.txt)
OLEDB CONNECT TO [...;Data Source=$(vDATASOURCE);...]
Hi Daniel,
Thanks for your reply,I created a txt file with the name of the server in it and inside the Datasource i gave the vDATASOURCE thing but when i hit a reload its asking me for the name of the server each and every time.Is there any way to get around it?I included the name of the server in my text file .
Thanks,
Sujith.
Is it asking for the server name or for the connection credentials?
It is asking for the server name as well as the Login Credentials however if i just mention the server name and hit ok it takes it and reloads the script.
Does it work fine if you don't use the variable and just write the source name in the script? Or does it still ask you for the server name?
Hi Daniel,
Let me be clear here I created a text file named servers.txt which has
let vDATASOURCE = 'JJLEDW1';
inside it.I also created a variable named 'vDATASOURCE' and set the Input Constraints to No Constraints and didnt give any value for the variable either.
Inside the script task ,I did something like this
$(Include=Servers.txt)
OLEDB CONNECT TO [.............Data Source=$(vDATASOURCE);........]
Now when i hit a reload its asking me for the server name?
Can you correct me if i went wrong somewhere?
Thanks,
Sujith.
Sorry Sujith, I made a mistake, you need to write the entire connection string into the text file.
Hi Daniel,
thanks it worked i copied the whole connection string into a text file and used a incluse statement inside the script task to call the file.
Thanks.