Avatar

Level 3

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.