Jump to content

Recommended Posts


How to detect / determine if requested ODBC driver is not available? Not installed?  Is there a specific function / error code to check for?

I asked this on the ADO.UDF support page, but I think the issue is not limited to that UDF.  What test can be run to determine if the requested ODBC data driver is available?



Why is the snake in the sky?

Link to post
Share on other sites

My UDFs and Tutorials:


Active Directory (NEW 2022-02-19 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version - Download
Outlook Tools (2019-07-22 - Version - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki
WebDriver - Wiki


Link to post
Share on other sites

Thx :)


Might not have been as straightforward as we would have liked but you know what they say: a list of installed ODBC drivers is a list of installed ODBC drivers. (We’re not sure why they say that, but at least in this case it makes some sense.)



Why is the snake in the sky?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Dwalfware
      Hi Folks
      Can not get my head around this one.
      This function gets the DNS object s
      If you have two DNS entries fine. but if you have only one! Trouble
      $objItem.DNSServerSearchOrder[0] = Primary DNS
      $objItem.DNSServerSearchOrder[1] = Secondry DNS not always there. I need a way to return 0 if not there or the IP if its there.
      Or is there a way to tell how many objects there are in the "[?]"
      I'm terrible at WMI errors, thanks for help in advance.
      Func _GETcurrentNICinfo2() $oErrors = ObjEvent("AutoIt.Error", "Error_Handle") Local $DnsSecondry Local $objWMIService = ObjGet( "winmgmts:\\" & @ComputerName & "\root\CIMV2" ) Local $query = $objWMIService.ExecQuery("SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration WHERE Index = " & _GetSelectedNIC(), "WQL", 0x30 ) If @error Then Return 0 If NOT IsObj($query) Then Return 0 Else For $objItem In $query Return $objItem.DNSServerSearchOrder[1] next Endif EndFunc  
    • By j0kky
      Hi folks,
      Last morning I needed to know programmatically which were my DNS(s) for the current connection, and I searched for an API which fitted my needs... I just tried dnsqueryconfig, which shows the DNS(s) used, if you have manually selected them in the past. 
      The API is little tricky (or maybe I'm little rusty), so I decided to write a small UDF function to avoid a waste of time in the future... here you are.
      ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_DnsQueryConfig ; Description ...: Retrieves the currently used DNS servers, if they were selected by user ; Syntax.........: _WinAPI_DnsQueryConfig() ; Return values .: On success it returns an array with the list of currently used DNS servers ; ; On failure it returns 0 and sets @error to non zero (these values are useful only for debugging reasons): ; |1 - DllCall error ; |2 - Generic error, DNS could be generated automatically ; Author ........: j0kky ; Modified ......: 1.0.0 14/11/2018 ; Link ..........: https://docs.microsoft.com/en-us/windows/desktop/api/windns/nf-windns-dnsqueryconfig ; =============================================================================================================================== Func _WinAPI_DnsQueryConfig() Local Const $DnsConfigDnsServerList = 6 Local $aRet = DllCall("Dnsapi.dll", "LONG", "DnsQueryConfig", "int", $DnsConfigDnsServerList, "dword", 0, "ptr", Null, "ptr", 0, "ptr", Null, "dword*", 0) If @error Then Return SetError(1, 0, 0) if $aRet[6] <= 4 Then Return SetError(2, 0, 0) Local $tagBuffer = "" For $i = 1 To ($aRet[6] / 4) $tagBuffer &= "dword;" Next Local $tBuffer = DllStructCreate($tagBuffer) $aRet = DllCall("Dnsapi.dll", "LONG", "DnsQueryConfig", "int", $DnsConfigDnsServerList, "dword", 0, "ptr", Null, "ptr", 0, "ptr", DllStructGetPtr($tBuffer), "dword*", $aRet[6]) Local $aDNS[($aRet[6] / 4) - 1] For $i = 2 to (UBound($aDNS) + 1) $aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "dword", DllStructGetData($tBuffer, $i)) if @error Then Return SetError(1, 0, 0) $aDNS[$i - 2] = $aRet[0] Next Return SetError(0, 0, $aDNS) EndFunc
    • By hugomito
      Hi all,
      I hope you can help me with this. I need to connect to a Database using Cloudera ODBC Driver for Impala. I installed the driver, created a User DSN (drona2) and tested it successfully (got the message: Successfully connected to data source!) but when I try to connect to the database using a Conneciton String, it simply didn't work.
      I tried connecting to the database using the User DSN, I previously created, that has all parameters needed but got the following error:
           $ProviderDatasource = 'DSN=drona2;'
           $conn_Database = ObjCreate ("ADODB.Connection")
           $conn_Database.ConnectionString = $ProviderDatasource
           ==> The requested action with this object has failed.:
           $conn_Database.Open^ ERROR
      Also I tried adding all parameters to my connection string as follows but also got the same error:
           $ProviderDatasource = 'Driver=Cloudera ODBC Driver for Impala;Host=MyHost.domain.com;PORT=21050;AuthMech=3;UID=MyUserId@domain.com;PWD=MyPasswordc;Schema=default;SSL=1;AllowSelfSignedCerts=1;AllowHostNameCNMismatch=1;CheckCertRevocation=1;KrbFQDN=_HOTS;KrbServiceName=impala;ServicePrincipalCanonicalization=1'
      I hope someone has used this driver successfully before and can shed some light here.
      If you need additional information, let me know.
    • By cookiemonster
      Im about to start making an autoit script that will read the current ODBC settings, have a drop down to select a different one which would then update the ODBC in windows to use the new settings.
      Can anyone point me in the direction of how to read the ODBC 32 bit settings? are they in the registry?
    • By pupitetris
      Hi. I just released this software, we need it to override the DHCP server at work. Our DHCP server does not allow per-mac-address configuration, so I coded this utility to allow our developers to use our area's custom DNS server, regardless of what DHCP provides, and let them have the possibiity to quickly shift to automatic configuration when they take their laptops home.

      An afternoon's worth of coding, and another half day for polish and release. Pretty old-school simplicity; it was a good excercise to finally code some UI using AutoIt.
      Hope it's useful to someone.
  • Create New...