Groups | Blog | Home
all groups > sql server dts > january 2005 >

sql server dts : Change DSN Source Path


Paul
1/5/2005 1:21:02 PM

Is there an easy way to change the source path for a DSN using the DTS
object model?

I have a DTS to import DBFs into SQL. Because I want to do some complex
join queries with the DBFs while importing I cannot use the native dBase
connection object. I am using a DSN with the Visual Fox Pro Driver.

The source path changes on a daily basis. The path name is based on date.
Renaming the path to something fixed is not an option due to parrallel
processes. Copying the data to a fixed path is not an option due to the
volume of data. I need to dynamically change the source path of the DSN.

I came across VBscript code to change the source path of a system DSN by
creating a reference to a shell script object and playing around with the
registry. I could alternatively use file IO code to update a file DSN. What
I am hoping for is an easy way to change the source path of the DSN using the
DTS object model.

Is this possible?

Thanks.

Paul
JFB
1/5/2005 11:10:31 PM
Here is an example where you can get the idea.
http://www.sqldts.com/default.aspx?200
Rgds
JFB

[quoted text, click to view]

Paul
1/6/2005 5:39:13 AM

Thanks for the reply. I have seen and used that code before. However it
does not work on an ODBC DSN connection object in DTS. The DataSource
property simply changes the name of the DSN you are using. Any other ideas?

Thanks again.

Paul


[quoted text, click to view]
JFB
1/6/2005 10:38:05 AM
Ok Paul maybe the easy way is to use UDL connection. It's easy to replace
the file...
JFB

[quoted text, click to view]

Paul
1/6/2005 12:55:05 PM

Excellent. That looks like what I need. I never used UDL connections
before.

Thanks for the help!

Paul

[quoted text, click to view]
AddThis Social Bookmark Button