Re: Finding Out DSN Selected by User



Alok wrote:
Gurus I need some help with ADO.
I have an application where I use the following commands to invoke
the DSN dialog box so that user can select the appropriate DSN.

Dim con as new ADODB.Connection
con.ConnectionString = ""
con.Properties("Prompt").value = adPromptAlways
con.Open

Once the connection is open how can I find out the name of the DSN
that the user selected.

I've never done this (allowed users to select the DSN) but I suspect you
can find out by checking the connection's ConnectionString property
after the connection is open.

You might want to consider an alternative approach:
prompt the user to select a database/server from a pre-defined list to
connect to instead of a DSN, and use the selection to build a DSNless
connection string instead of using a DSN
(http://www.aspfaq.com/show.asp?id=2126)



--
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: Linking to back end on a web server ?
    ... When I do the File--Get External Data and select the DSN, ... "You cannot use ODBC to import from, export to, or link an external ... Microsoft Jet or ISAM database table to your database. ... that DSN-based connection to a DSN-less connection. ...
    (microsoft.public.access.externaldata)
  • Re: How to Upgrade SQL back end of Access linked tables.
    ... If the file's extension is ADP then this is where your error is: ... you directly connect to a SQL-Server and this connection is using ... so there is no notion of DSN or DSN-Less ... dsn-less connection to SQL Server? ...
    (microsoft.public.access.externaldata)
  • Re: How to Upgrade SQL back end of Access linked tables.
    ... you directly connect to a SQL-Server and this connection is using ... so there is no notion of DSN or DSN-Less ... Sylvain Lafontaine, ing. ... I didn't have linked table manager under ...
    (microsoft.public.access.externaldata)
  • Re: Use of VisualFoxpro 8 data source.
    ... You will either need to make the connection via MS Query (it's on the Tools ... menu in the Select Data Source dialog box) or using VBA. ... > An existing driver for VFP tables on the 'User DSN' tab. ... > An existing driver for VFP tables on the 'System DSN' tab. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word could not reestalish a DDE connection to ACCESS DB
    ... which does not need a DSN. ... conversion at open" is checked) you should see the DDE option and you should ... When you make a connection to a data source in Word, ...
    (microsoft.public.word.mailmerge.fields)

Loading