Solved

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

Posted on 2001-06-07
5
511 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

828 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