Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2001-06-07
5
Medium Priority
?
533 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 800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

885 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