none
Add-OdbcDsn giving error code 11 RRS feed

  • Question

  • This "should" be simple, yet, here I am. So, I'm just trying to add a 32-bit System DSN, using Add-OdbcDsn as follows:

    Add-OdbcDsn'mydb'-DriverName'Pervasive ODBC Engine Interface'-DsnTypeSystem-Platform32-bit

    One would think, nice, and done...but not so. Getting:

    Add-OdbcDsn : Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed (Installer error code: 11).

    The driver name is valid. If I do a Get-OdbcDsn - DriverName of the same (copied and pasted to be sure), I get other DSNs that already exist. I am running Powershell ISE as Administrator when I do this. I've searched for this error, and found things such as already mentioned (invalid driver file or not running as admin), but I can't find anything else.

    What am I missing now? :)

    Thanks in advance!

    mpleaf


    • Edited by mpleaf Tuesday, March 25, 2014 11:10 PM
    Tuesday, March 25, 2014 11:09 PM

Answers

  • I was able to figure this out. There were parameters that the driver was requiring, that I was missing in my dsn. I was looking at vb code that was created for an older version. I had to monkey with it long enough to figure out the property values. I created one from the UI, that told me what the properties it "wanted" were, then I was able to supply those in my add-odbcdsn command.

    All good, and yet more .bat and vb stuff replaced!

    mpleaf

    • Marked as answer by mpleaf Wednesday, March 26, 2014 10:11 PM
    Wednesday, March 26, 2014 10:10 PM

All replies

  • Are you sure pervasive supports this?

    Contact Pervasive to find out what return code 11 means.


    ¯\_(ツ)_/¯

    Wednesday, March 26, 2014 12:36 AM
  • Perhaps: IM011 Driver name too long


    ¯\_(ツ)_/¯

    Wednesday, March 26, 2014 12:47 AM
  • I have many that are set up already similarly, using the same driver name. Pervasive requires it.

    mpleaf

    Wednesday, March 26, 2014 2:37 PM
  • I have 6 set up on the same server, using the same driver name. They were obviously set up manually through the UI or from VB, but I would not think it should be an issue for PS?

    mpleaf

    Wednesday, March 26, 2014 2:39 PM
  • Quick search on the IM011 error says:

    The attribute value for the DRIVER keyword was longer than 255 characters.

    This is definitely not 255 characters.

    mpleaf

    Wednesday, March 26, 2014 2:41 PM
  • You need to contact the vendor to find out what their error 1 refers to.  I was just guessing that it might be a flavor of an installer message.

    Note that you also have to run elevated. I can add a DSN wih no issue but I do not have the Pervasive client installed.


    ¯\_(ツ)_/¯

    Wednesday, March 26, 2014 2:44 PM
  • I am running elevated ISE. Are you saying the add-odbcdsn command for PS might be depending on the driver being used? So, the error is not so much the PS attempt to add the driver, but with the driver from Pervasive? If that's the case, why can I add it using the UI without trouble?

    mpleaf

    Wednesday, March 26, 2014 2:46 PM
  • Wondering if maybe I just need to create the registry keys for it, and do it that way? I certainly can do that pretty easily. Is that all a DSN really does?

    mpleaf

    Wednesday, March 26, 2014 2:54 PM
  • ...and yet, if I specify a different driver, such as 'SQL Server', you are quite correct that it adds without issue, leading me to believe you are on to something about the driver.

    *sigh*

    mpleaf

    Wednesday, March 26, 2014 3:06 PM
  • I was able to figure this out. There were parameters that the driver was requiring, that I was missing in my dsn. I was looking at vb code that was created for an older version. I had to monkey with it long enough to figure out the property values. I created one from the UI, that told me what the properties it "wanted" were, then I was able to supply those in my add-odbcdsn command.

    All good, and yet more .bat and vb stuff replaced!

    mpleaf

    • Marked as answer by mpleaf Wednesday, March 26, 2014 10:11 PM
    Wednesday, March 26, 2014 10:10 PM
  • For me the following worked to add the ODBC connection (without the error):
    add-odbcdsn -Name myTest -DriverName "IBM DB2 ODBC DRIVER - DB2" -DSNType "System" -Platform 32-bit -SetPropertyValue @("DBALIAS=TEST","Description=Test")

    Hope this helps!

    Tuesday, January 20, 2015 9:45 PM