Re: Finding Out DSN Selected by User



Alok wrote:
Thanks Bob,
I was trying to avoid parsing of the Connection String. Is it
possible to get the DSN without parsing?

Not that I know of. it's not hard to parse it though:

dim sConnect, ar1, ars, sDSN
sConnect = con.connectionstring
ar1=Split(sConnect, "Data Source")
ar2=Split(ar1(1), ";")
sDSN=mid(ar2(0),2)

using a regex would be a little easier.

I was hoping to use the Data
Source Name property of the connection object but that does not work
- at least when I select a DSN which is to an Access database.
Incidentally I am doing this so that I can write a generic program so
that the user can look at the data in any of the databases for which
a DSN is set up on the computer.
Alok

So why do you need the name of the DSN?

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: Create DSN Programmatically
    ... Referring to the connection string as a Data ... > Source Name (DSN) is a naming convention used to refer to the connection ... Only in the case of ODBC API ...
    (microsoft.public.vsnet.general)
  • Re: Trying to connect to MySQL db with DAO using ODBC
    ... the connection string I'm using is copied from the example in the ... I did as you suggested and created a DSN. ... works while the 'apparently' equivalent DSN-less connection string does not. ... your code set or add all the properties exactly as you see ...
    (microsoft.public.vb.database.dao)
  • Re: Problems with Access 2003 and SQL Server 2005
    ... Driver in its place. ... Sylvain Lafontaine ... A DSN is just an alias for a connection string that is stored in the ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Using user id and pwd in data source name
    ... If you have a DSN, then all you need to do is to specify this DSN in your ... connection string and it should work. ... ADO does not work with ODBC directly, then ADO will place OLEDB for ODBC ... In the system dsn you>specify all the ODBC information like user, password, server, database>name, etc. ...
    (microsoft.public.data.ado)
  • Re: How to create DSN using asp.net?
    ... William Vaughn ... "Shibu" wrote in message ... > DSN ... >> solution where the connection string contains all of the needed ...
    (microsoft.public.dotnet.framework.adonet)