On LC Designer, I set up a data connection called DataConnection1 to access a certain file named a001.xls,
Here is the xml shows:
<sourceSet xmlns="http://www.xfa.org/schema/xfa-source-set/1.0/">
<source name="DataConnection1" db="ado">
<connect delayedOpen="1" timeout="15">
<connectString>Provider=MSDASQL.1;Persist Security Info=False;Data Source=Excel Files;Mode=Read;Extended Properties="DSN=Excel Files;DBQ=C:\a001.xls;DefaultDir=C:;DriverId=790;MaxBufferSize=2048;PageTimeout=5;"</connectString>
<user/>
<password/>
</connect>
<command timeout="30">
-----------------------
I can display the value of xfa.sourceSet.DataConnection1.connect.connectString.value which shows above string.
Now I change the connectString via a button click such that I can use another file named a002.xls for the data connection by :
new_connStr = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Excel Files;Mode=Read;Extended Properties=\"DSN=Excel Files;DBQ=C:\\a002.xls;DefaultDir=C:;DriverId=790;MaxBufferSize=2048;PageTimeout=5;\"";
xfa.sourceSet.DataConnection1.connect.connectString.value = new_connStr;
Then when I display the value again, it still remains the same old connect string value.
Any ideas?
Rgds.
Solved! Go to Solution.
Views
Replies
Total Likes
The sourceSet is locked down after the form is rendered. It is a security violation to change it after rendering. If you open the javascript console I am sure you will see a security violation error.
Paul
Views
Replies
Total Likes
The sourceSet is locked down after the form is rendered. It is a security violation to change it after rendering. If you open the javascript console I am sure you will see a security violation error.
Paul
Views
Replies
Total Likes
Dear Paul,
I see...
thanks for that.
Views
Replies
Total Likes