Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I'm from a Linux+Postgres background so all this stuff about DSN, ODBC, and Microsoft Data Source Administrator is new to me. Is there any link/article that explains the following for a newbie:

  • DSN is a name given to a complete connection string, right? This includes at least the server-name, db-name, host, port, username, and password
  • Microsoft Data Source Administrator maintains a DSN => connection-string mapping on the local machine, right?
  • DSN is always looked-up on the local machine, right? Which means, that if I'm connecting to a remote database, the DSN needs to still be configured on my local machine. The DSN registry of the remote machine doesn't come into the picture.

PS: This is a follow-up from https://sqlanywhere-forum.sap.com/questions/35914/mobilink-connection-string-works-with-dbping-but-not-with-mlsrv

asked 04 Sep '20, 09:31

saurabhnanda's gravatar image

saurabhnanda
46121219
accept rate: 0%

On Windows.

(04 Sep '20, 10:06) saurabhnanda
Replies hidden

Note, Reg hasn't recommended to necessarily use a DSN but to always provide connection parameters for database server (host, servername, port if non-standard) and the database name (DBN=) in order to prevent undesired connections to other databases because SQL Anywhere uses several defaults by design - and that is not always too obvious. (Been there, done that.)

(04 Sep '20, 10:29) Volker Barth

> Reg hasn't recommended to necessarily use a DSN

Actually, Reg did say exactly that: "The DSN parameter is required in the connection string for the MobiLink Server."

I can't remember ever having used a DSN-less connection to mlsrv17.exe, but the Help seems to imply it is possible: "Connection parameters must be included in the ODBC data source specification if not given in the command line."

It's worth testing, but I'm feeling lazy (step 1 would be "install Linux" :)

(04 Sep '20, 10:52) Breck Carter
2

I use DSNless connections for MLSrv17. Lets assume that you are using SQL Anywhere 17. The basic DSNLess connection would look like:

mlsrv17 -c "driver=SQL Anywhere 17;
            server=<SQLA server name>;
            dbn=<dbname>;uid=dba;pwd=sql"
         <... other ml server options ...>

If your consolidated is not SQLA, you simply need to determine the Driver Name to supply to 'driver' and connection parameters specific to that DBMS.

(04 Sep '20, 11:12) Chris Keating

Oops, I apparently just focussed on Reg's comment, not his answer.

(04 Sep '20, 11:43) Volker Barth

Are you asking about DSN usage on Windows or on Linux?

Here is a general link with further sub-topics:

ODBC data sources

To your questions:

DSN is a name given to a complete connection string, right? This includes at least the server-name, db-name, host, port, username, and password

No, you can also just store some connection parameters (e.g. Servername/Host and DBN) in the DSN, and add others (say, UID etc.) when building the connection string - it's up to you...

DSN is always looked-up on the local machine, right?

DSNs on Windows can be either machine-specific (aka System DSNs) or machine-and-user-specific (User DSN), so yes, they are specific to the client machine. - Additionally, SQL Anywhere allows for non-machine-specific FileDSNs to share DSNs between machines. So you could use a FileDSN stored on a net share that can be used by different client machines.

permanent link

answered 04 Sep '20, 10:02

Volker%20Barth's gravatar image

Volker Barth
40.2k361550822
accept rate: 34%

edited 04 Sep '20, 10:21

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×17

question asked: 04 Sep '20, 09:31

question was seen: 1,326 times

last updated: 04 Sep '20, 11:43