Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / July 2008

Tip: Looking for answers? Try searching our database.

Listing DSN`s in the system

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DagL - 17 Jul 2008 14:04 GMT
Hello!

I have made a screen with code that allows users to link in tables for other
databases, using ODBC. I then use the DoCmd.TransferDatabase - to do this.
But, the program must know the name of the DSN to connect through. I have
made an entry field so the user can type in this name.

The problem is that most of the users don`t know the name, and does not
remember it more than one day. Therefore, I need to list the names of the
DSN`s that is registered at the computer.

Does anyone has some idea of a .dll / function to use for this?

Best regards
DagL
Stuart McCall - 17 Jul 2008 15:24 GMT
> Hello!
>
[quoted text clipped - 12 lines]
> Best regards
> DagL

Try this:

http://www.smccall.demon.co.uk/MiscApi.htm#DsnListbox

Just what you're looking for, by the sound of it.
DagL - 18 Jul 2008 09:16 GMT
> Try this:
>
> http://www.smccall.demon.co.uk/MiscApi.htm#DsnListbox
>
> Just what you're looking for, by the sound of it.

Exactly!
Very nice, I had my program up and running within 15 min.
Thank you for the tip!

Regards DagL
Tony Toews [MVP] - 18 Jul 2008 01:33 GMT
>I have made a screen with code that allows users to link in tables for other
>databases, using ODBC. I then use the DoCmd.TransferDatabase - to do this.
[quoted text clipped - 4 lines]
>remember it more than one day. Therefore, I need to list the names of the
>DSN`s that is registered at the computer.

Why not go DSN less?  

I much prefer DSN-Less connections as it is one less thing for someone
to have to configure and one less thing for the users to screw up.
This is also better for Citrix/TS farms where each individual system
would have to have a DSN created and maintained.

Using DSN-Less Connections
http://www.accessmvp.com/djsteele/DSNLessLinks.html
ODBC DSN-Less Connection Tutorial Part I
http://www.amazecreations.com/datafast/GetFile.aspx?file=ODBCTutor01.htm&Article=true
HOWTO: Use "DSN-Less" ODBC Connections with RDO and DAO
http://support.microsoft.com/?id=147875
ODBC DSN Less
http://www.carlprothman.net/Default.aspx?tabid=81
Relink ODBC tables from code
http://www.mvps.org/access/tables/tbl0010.htm

Tony
Signature

Tony Toews, Microsoft Access MVP
  Please respond only in the newsgroups so that others can
read the entire thread of messages.
  Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
  Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

DagL - 18 Jul 2008 09:15 GMT
> Why not go DSN less?  
> Tony

I have looked at this, but I need to use DSN. The ODBC driver that we use,
demand a DSN to set up paths to the data files (COBOL data files), security
and other settings. So I must use a DSN unfortunately.

Thanks for the tip anyway, maybe I can use it later on.

Regards DagL
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.