Solved

DTS: Possible to reuse DSN info when creating DTS connection?

Posted on 2001-06-07
5
507 Views
Last Modified: 2013-11-30
Hi,

I'm using DTS to transfer data from Excel etc. to different MS SQL 2000 databases.
To create a new DTS connection to MSSQL you need to specify:
-DataSource(servername)
-Catalog(database name)
- UseTrustedConnection (NT authentication used)
- UserID
- Password
   
All these parameters are already present in my DSN (ODBC or OLEDB), and I only want this information in one place(the DSN). How can I reuse this information (either by telling DTS connection to use DSN or by getting the info from DSN and manually provide them to the DTS connection) ?

Any help would be appriciated.

Regards
Thomas Sorensen
0
Comment
Question by:tns1
  • 2
5 Comments
 
LVL 4

Expert Comment

by:Jeremy_D
ID: 6168121
In the DTS designer, choose "Other (ODBC Data Source)" as your destination (instead of "Microsoft OLE DB Provider for SQL Server"). You will then see a choice of existing system and user DSN's and be able to browse for a file DSN. If the username and password are stored in the DSN you should be able to connect using them by just leaving the username and password boxes in the "Choose a destination" dialog empty.
0
 

Author Comment

by:tns1
ID: 6168233
I'm using COM objects to access DTS programmatically, so I need to specify DSN or get info from DSN in my code.
0
 
LVL 4

Accepted Solution

by:
Jeremy_D earned 200 total points
ID: 6176277
I don't think you can specify a DSN for an SQL DMO connection, but you can find out the specific information if you know the name and type of the DSN.

You can find the DSN information in the following places:
- File DSNs: Directory {$ProgramFilesDir}\Common Files\ODBC\Data Sources\{$DataSourceName}.dsn
  These are simple text-files like an INI file which you can read using standard file IO.
- System DSNs: Registry key HKLM\Software\ODBC\ODBC.INI\{$DataSourceName}
- User DSNs: HKCU\Software\ODBC\ODBC.INI\{$DataSourceName}
  System and User DSNs can be read using standard registry access methods.
0
 

Expert Comment

by:CleanupPing
ID: 9282286
tns1:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now