Creating DSN remotely

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
metabill
Premium Member
Premium Member
Posts: 26
Joined: Wed Aug 27, 2003 9:55 am

Creating DSN remotely

Post by metabill »

Greetings. I would like to be able to create system DSNs on my DataStage server, but from my remote client PC. This is to just avoid the hassle of getting onto the server for this task. I couldn't easily find an acceptable package to do this, and am think of writing a small client/server app myself for this purpose. Do you know of an existing solution for doing this? Thanks in advance..

-Bill
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Bill,

Do you have access to Remote Desktop Connection via your client? I think this would be the easiest and simplest way of doing this.

Here is an example call to programmatically create a DSN for Excel -

Code: Select all

SQLConfigDataSource(NULL,ODBC_ADD_DSN, "Excel Files (*.xls)", 
                   "DSN=New Excel Data Source\0" 
                   "Description=New Excel Data Source\0" 
                   "FileType=Excel\0" 
                   "DataDirectory=C:\\EXCELDIR\0" 
                   "MaxScanRows=20\0");
This is just one example and each vendor would require something slightly different and these requirements may/may not be published.

There are limitations on the kinds of programmatic access a vendor will allow. As an example - when setting up a DSN for Access (via the ODBC manager) you can either point to an existing .mdb or create a new .mdb, but programmatically you can only point to an existing since there is no facility to programmitcally create the DSN to create the .mdb

Regards,
metabill
Premium Member
Premium Member
Posts: 26
Joined: Wed Aug 27, 2003 9:55 am

Post by metabill »

Thanks for the suggestions. I do indeed have access to Remote Desktop Connection, but this is a bit of an annoyance for me, and does not address the similar needs of other folks who do not have this priviledge, so I was thinking of a perhaps more simple and direct solution. Since the Perl Win32::ODBC module supports creation of DSNs, I was thinking of writing a small client/server app in Perl to follow the programmatic approach, as you suggest.

-Bill
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

It would be easy to write in a routine because you need a prototype on the DSN you want and then just append it to the file. You need a lot less in each project. I am sure it could be written in a few minutes. Maybe tomorrow.
Mamu Kim
Post Reply