Change ODBC connection from front end

I need to create a form that will populate a combo box with a list of all of the available ODBC connections (read from the system).
Selecting one will connect the front end to that database and update all of the linked tables to the ODBC connection.

Where would I even begin to create such a form??!!!
fuerteventuraAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
user dsn are stored in the registry

HKEY_CURRENT_USER\Software\Odbc\Odbc.ini\Odbc Data sources
0
 
Rey Obrero (Capricorn1)Commented:
the systems dsn files are stored in
C:\Program Files\Common Files\ODBC\Data Sources

the dsn files can be open using notepad

is this what you are after?
0
 
fuerteventuraAuthor Commented:
Thanks for your reply, what I need is a way of populating a combo box with all the available ODBC data sources (user DSN). I then need to be able to select them and update all my linked tables to this connection.
0
 
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
fuerteventura,

You can load filenames into a listbox by using this:
http://allenbrowne.com/ser-59.html

I have seen this in a recent post here as well:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23155845.html
(You need to set a VBA reference to the Micrisoft Scripting Library)
Private Sub Form_Load()
Dim fso As New IWshRuntimeLibrary.FileSystemObject
Dim fld As Folder
Dim fil As File
Me.lstFiles.RowSource = ""
Set fld = fso.GetFolder(gstrMediaFolder)
For Each fil In fld.Files
    Me.lstFiles.AddItem fil.Name
Next fil
End Sub

Hope this helps as well

JeffCoachman
0
 
fuerteventuraAuthor Commented:
Thanks to all who helped
0
All Courses

From novice to tech pro — start learning today.