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?
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.
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
The DSN is the name you give your datasource in ODBC Administrator.
Bye
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