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: MySQL on Win 98
    ... Hitting the Verify Connection button in VFP produced a C5 crash. ... With a "System" DSN configured the same way (except for the Data ... Incorrect database name". ...
    (microsoft.public.fox.programmer.exchange)
  • 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)
  • Re: Alternative to using DSN to connect to database
    ... use a native driver where possible. ... Basically my problem is that the ODBC Connection Manager in Control Panel ... At present (since nearly all use the ODBC DSN Connection ...
    (microsoft.public.dotnet.framework.adonet)