Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is DSN?

1 view
Skip to first unread message

Ang Kok Ming

unread,
Feb 16, 1996, 3:00:00 AM2/16/96
to
I'm currently working on a db project using VB/SqlServer 4.21

Can anyone tell me what does it mean by Data Source Name?
The VB help isnt helpful at all. All it mentions is that is
is the name of the db server. It doesn't seem to work

The VB 3 statement needs the server's DSN, and I want to
to connect to Sql Server without the login dialog appearing

OpenDatabase(" DSN ", False, False, "ODBC;database=user;uid=sa;pwd=zzz;
DSN= ....)

I've tried putting the network path (\\NTSERV\SQLDB), the string
Sql server, and the name of the user's database, to no avail.

Any Idea?

Howard Rothenburg

unread,
Feb 21, 1996, 3:00:00 AM2/21/96
to
The DSN is the data set name that you set up in the odbc manger app.
odbcadm.exe on your client PC for connecting to SQLServer. You pick the
name and fill in what database it should use. Put that name in the
opendatabase command.

Walter W Zakowski

unread,
Feb 22, 1996, 3:00:00 AM2/22/96
to

The DSN refers to the database that is setup through ODBC on your client
workstation. The Opendatabase command should take the form of:

OpenDatabase("", False, False, "ODBC;DSN={ODBC Data Source Name},
UID={User ID},PWD={Password};)

I'm not familiar how to do it unless you hard code the userid and
password, or at least ask the user for that information.

Martin Herbener, mherbene@carleton.edu

unread,
Feb 22, 1996, 3:00:00 AM2/22/96
to
In article <4g26ee$h...@neptune.np.ac.sg>, 9360...@neptune.np.ac.sg (Ang Kok Ming) writes:
> I'm currently working on a db project using VB/SqlServer 4.21
>
> Can anyone tell me what does it mean by Data Source Name?
> The VB help isnt helpful at all. All it mentions is that is
> is the name of the db server. It doesn't seem to work


Data Source Name is an ODBC idea. If you go into the ODBC portion of Control
Panel you find a series of screens used to set up Drivers, which are specific
to the type of database that you want to reach, and Data Source (Name)s, which
are like aliases pointing to a specific database.

In order to get all this working, you should first make sure that you have the
SQL Server client tools installed. You can test your connection using W/ISQL.
Second, make sure you have a ODBC Driver for Ms SQLServer installed. This
should be available from MS in various ways; you may have it as part of your VB
or MS Access package, or you might be able to get it (there are actually a few
files involved) from an MS Technet or DevNet CD or the MS ftp site.

Once you have the driver installed you create a Data Source, which specifies
which driver (MS SQL Server), which server (use the same server name you use
for ISQL; it may or may not be the same as the NT server's name), and which
database on that server.

The effect of all this is to create entries in your ODBC.INI file, which is
what ODBC looks up when you specify a Data Source Name.

Good Luck
mher...@carleton.edu

Daniel Pepermans

unread,
Feb 23, 1996, 3:00:00 AM2/23/96
to
Ang Kok Ming wrote:
>
> I'm currently working on a db project using VB/SqlServer 4.21
>
> Can anyone tell me what does it mean by Data Source Name?
> The VB help isnt helpful at all. All it mentions is that is
> is the name of the db server. It doesn't seem to work
>
> The VB 3 statement needs the server's DSN, and I want to
> to connect to Sql Server without the login dialog appearing
>
> OpenDatabase(" DSN ", False, False, "ODBC;database=user;uid=sa;pwd=zzz;
> DSN= ....)
>
> I've tried putting the network path (\\NTSERV\SQLDB), the string
> Sql server, and the name of the user's database, to no avail.
>
> Any Idea?


The DSN is the name you give your datasource in ODBC Administrator.

Bye

Michael D. Moore

unread,
Feb 23, 1996, 3:00:00 AM2/23/96
to 9360...@neptune.np.ac.sg

The data source name (DSN) is the identifier used in the ODBC Admin program
to identify the data source.

Use ODBC Admin (available as a control panel applet under NT, or as a
program under Win16) to define a data source called (for example) MyDataSource.
Define the type of data source (SQL Server, Access, Excel, XBase etc.) and any other
parameters using the following dialog boxes. - By the way, if you see a checkbox labelled
"generate store procedures for queries" - turn this option OFF.
The data source is then "MyDataSouce".

I hope I haven't made this too confusing - it's a simple idea really.

Regards,
Michael Moore

0 new messages