![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#3
| |||
| |||
|
|
Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#4
| |||
| |||
|
|
I export the data into a flat file. I know that the connection has not changed because I can check the data and see that the DTS is taking the data from the DataBase that was defined when I built the DTS (using the Export wizard). I know that it's the right connection because if I change the other one (there are only two) I get the flat file not where I expected it to be. Many thanks in advance -- Elizabeth "Allan Mitchell" wrote: Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#5
| |||
| |||
|
|
OK so we are obviously in the right package and we can obviously change connections but it would appear not this one. We will need to find out to where the package thinks it points. To do this, change your package and add an active Script task as the very last thing. Add a package log to text file. Now do this in the function inside the task DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").DataSource DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").Catalog In the log that is written by the package you will now be able to see what the package thought happened. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com: I export the data into a flat file. I know that the connection has not changed because I can check the data and see that the DTS is taking the data from the DataBase that was defined when I built the DTS (using the Export wizard). I know that it's the right connection because if I change the other one (there are only two) I get the flat file not where I expected it to be. Many thanks in advance -- Elizabeth "Allan Mitchell" wrote: Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#6
| |||
| |||
|
|
Hi Allan, First - it was a very good idea to add the log file - thank you. Second, I don't know if it's good news or bad but the DataSource and the Catalog are correct. Still I don't get the right data. I was thinking of trying to use the Dynamic Properties Task - what do you think? Many thanks, -- Elizabeth "Allan Mitchell" wrote: OK so we are obviously in the right package and we can obviously change connections but it would appear not this one. We will need to find out to where the package thinks it points. To do this, change your package and add an active Script task as the very last thing. Add a package log to text file. Now do this in the function inside the task DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").DataSource DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").Catalog In the log that is written by the package you will now be able to see what the package thought happened. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com: I export the data into a flat file. I know that the connection has not changed because I can check the data and see that the DTS is taking the data from the DataBase that was defined when I built the DTS (using the Export wizard). I know that it's the right connection because if I change the other one (there are only two) I get the flat file not where I expected it to be. Many thanks in advance -- Elizabeth "Allan Mitchell" wrote: Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#7
| |||
| |||
|
|
You could yes use a DP task to do the assignments but by all accounts the assignments are happening anyway so I am not sure that this will fix your problem. If you do use a DP task, how do you intend to use it? I can then offer ideas on the best way. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:A9A16670-4698-44AA-838E-EA4D303B79B2 (AT) microsoft (DOT) com: Hi Allan, First - it was a very good idea to add the log file - thank you. Second, I don't know if it's good news or bad but the DataSource and the Catalog are correct. Still I don't get the right data. I was thinking of trying to use the Dynamic Properties Task - what do you think? Many thanks, -- Elizabeth "Allan Mitchell" wrote: OK so we are obviously in the right package and we can obviously change connections but it would appear not this one. We will need to find out to where the package thinks it points. To do this, change your package and add an active Script task as the very last thing. Add a package log to text file. Now do this in the function inside the task DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").DataSource DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").Catalog In the log that is written by the package you will now be able to see what the package thought happened. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com: I export the data into a flat file. I know that the connection has not changed because I can check the data and see that the DTS is taking the data from the DataBase that was defined when I built the DTS (using the Export wizard). I know that it's the right connection because if I change the other one (there are only two) I get the flat file not where I expected it to be. Many thanks in advance -- Elizabeth "Allan Mitchell" wrote: Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
#8
| |||
| |||
|
|
You could yes use a DP task to do the assignments but by all accounts the assignments are happening anyway so I am not sure that this will fix your problem. If you do use a DP task, how do you intend to use it? I can then offer ideas on the best way. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:A9A16670-4698-44AA-838E-EA4D303B79B2 (AT) microsoft (DOT) com: Hi Allan, First - it was a very good idea to add the log file - thank you. Second, I don't know if it's good news or bad but the DataSource and the Catalog are correct. Still I don't get the right data. I was thinking of trying to use the Dynamic Properties Task - what do you think? Many thanks, -- Elizabeth "Allan Mitchell" wrote: OK so we are obviously in the right package and we can obviously change connections but it would appear not this one. We will need to find out to where the package thinks it points. To do this, change your package and add an active Script task as the very last thing. Add a package log to text file. Now do this in the function inside the task DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").DataSource DTSPackageLog.WriteStringToLog DTSGlobalVariables.Parent.Connections("Name of connection").Catalog In the log that is written by the package you will now be able to see what the package thought happened. Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:43E0BE70-D465-4B17-BDB8-FF745537A348 (AT) microsoft (DOT) com: I export the data into a flat file. I know that the connection has not changed because I can check the data and see that the DTS is taking the data from the DataBase that was defined when I built the DTS (using the Export wizard). I know that it's the right connection because if I change the other one (there are only two) I get the flat file not where I expected it to be. Many thanks in advance -- Elizabeth "Allan Mitchell" wrote: Are you sure you are changing the right connection? Can you use the name of the connection instead of the ordinal number? What makes you say that the connectio nhas not changed? Allan "Elizabeth" <Elizabeth (AT) discussions (DOT) microsoft.com> wrote in message news:63A29109-2E88-4E6E-B521-DFD7F7498E64 (AT) microsoft (DOT) com: Hi there, I built a new DTS using the Export Wizard and saved it. Now, in order to have the data base dynamic, my code (visual basic) goes like this: MyPack.LoadFromStorageFile Fname, passwrd MyPack.Connections.item(1).DataSource = sServer MyPack.Connections.item(1).Catalog = sDataBase MyPack.Execute But, it doesn't help. Still, the export is done from the original data base that I chose when I built the DTS. What do I miss? Many thanks -- Elizabeth |
![]() |
| Thread Tools | |
| Display Modes | |
| |