Results 1 to 2 of 2

Thread: Connecting to Database with DSN vs. DSN-Less

  1. #1

    Thread Starter
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    To the moon and then left

    Connecting to Database with DSN vs. DSN-Less

    Hi Folks,

    using DAO/VBA (Excel) i'm successful to connect to our DB2 with my system-DSN, and then to send Queries to it.
    Now, i've tried to connect without a DSN by providing the pertinent parameters (SYSTEM, UID, PWD, DRIVER) acc. to famous Internet-Source called Connectionstrings.com

    The thing is: I get a successful connect, but sending a Query to it results in Error 3146 - ODBC-Call failed, with more thorough inspection Jet-Error 3001 - Invalid argument
    The query definitely works, as with a DSN it works, and with a SQL-Workbench-Tool it works too (expected results).

    Now Logic dictates: There is something the DSN provides, but my connection string is missing.
    Using something entirely not pertinent to this discussion, i even managed to read out the "OutConnectionString" the underlying SQLDriverConnect-Method provides, to find out the "real" connection-string my Connect with DSN used.

    Color me suprised, when that connection-string "DSN=DB2;UID=MyName;PWD=MyPWD" returned.....

    Is there any way EXCEPT exporting the complete registry-key containing my DSN to find out what's missing in my DSN-less call?
    One System to rule them all, One IDE to find them,
    One Code to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    I say you're crazy not to!
    For health reasons i try to avoid reading unformatted Code

  2. #2
    King of sapila
    Join Date
    Oct 2006

    Re: Connecting to Database with DSN vs. DSN-Less

    Haven't used the DSN method so I would respond on what I would have checked excluding DSN specific.
    1) The Jet engine is in the latest version. Newer excel require newer jet engine.
    2)Connections type of the datasource. For example native client or OLEDB
    3)Ports' UPD ports etc let's data pass trough.

    Of course it may be DSN specific that, I can't answer for that.
    Slow as hell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width