9

Is it possible to export a CSV file of the list of database driver names from the Create New Data Source of the ODBC Data Source Administrator?

ODBC Data Source Administrator Create New Data Source

1 Answer 1

9

Does this article correctly describes how frustrated you feel? Obviously there is no easy way of getting this info... unless you consider upgrade to win 8 an easy way :-(

I used information in this article to make a powershell equivalent for you (you're on win 7 so ps v2 is installed by default):

get-itemproperty -path hklm:\software\odbc\odbcinst.ini\"Odbc drivers" |
get-member | 
where {$_.definition -match "installed"} |
select-object name | export-csv -noTypeInformation

Fire up powershell and paste above (you may need to press Enter key once or twice afer you paste). It will then ask you to give path - this is a path and file your data will be exported to (eg. c:\temp\myDrivers.csv) - press Enter - and if everything went well a file with driver list will be produced for you.

Edit: this will give additionally version and dll used.

get-itemproperty -path hklm:\software\odbc\odbcinst.ini\"Odbc drivers" |
get-member |
where {$_.definition -match "installed"} |
foreach-object { get-itemproperty -path $("hklm:\software\odbc\odbcinst.ini\"+ $_.name)} |
select-object PSChildName,Driver|Add-member -MemberType ScriptProperty -Name FVersion -Value {(((get-item $this.Driver).versionInfo)).FileVersion} -PassThru |export-CSV -noTypeInformation
5
  • Well there they be...so hklm stands for HKEY_LOCAL_MACHINE of registry fame...I'll be darn....and if you dig into the registry there, you can find out things like what dll's make up the driver...and what file extensions it supports...however...I don't see a driver version...that's odd...I wonder where they store that...in the DLL maybe?
    – leeand00
    Jul 29, 2012 at 2:34
  • I looked at the properties of the DLL and that must be where it's getting the version numbers from because they match the ones in the "Create New Data Source" window. The dates and company names are in there as well.
    – leeand00
    Jul 29, 2012 at 2:56
  • So it's probably possible to use something like this in the script (obtaining the driver filename first of course....stackoverflow.com/questions/30686/…)
    – leeand00
    Jul 29, 2012 at 3:04
  • 1
    @leeand00 I've changed script so it returns more data. Beware I'm not PS expert so it may be not best way to code that
    – wmz
    Jul 30, 2012 at 0:28
  • 2
    On Windows 7 64-bit, the 32-bit drivers are found under the following registry path: hklm:\software\wow6432Node\odbc\odbcinst.ini Note that some drivers found here (default Microsoft stuff), may not have a Path key-value pair, and will cause an error when running the powershell script posted in the answer, so some error-handling would have to be added.
    – cowb0y
    Nov 28, 2014 at 7:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .