+ Reply to Thread
Results 1 to 9 of 9

ODBC Connection

  1. #1
    Registered User
    Join Date
    03-08-2019
    Location
    MA
    MS-Off Ver
    2013
    Posts
    5

    ODBC Connection

    Hello,

    I have an Excel 2013 file that has multiple ODBC connections that I am trying to save the user ID and password with and am having problems. I've tried a number of things, but no luck so far.

    Any suggestions would be appreciated.

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: ODBC Connection

    The way to do it is go to the Data tab and select Queries & Connections, then right click the connection and select properties. On the definition tab, there is a checkbox to Save Password. A word of warning: the password is saved in clear text in the connection string. So, it would be a good idea NOT to share the workbook with people you cannot trust to have the password.

    I have some users who use workbooks that have multiple queries, all to the same database. I have some code that prompts them for their password, does the query and then removes the password.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    03-08-2019
    Location
    MA
    MS-Off Ver
    2013
    Posts
    5

    Re: ODBC Connection

    Hi,

    Thanks for your reply. I tried that and the user ID and password are not being retained. Any other suggestions?

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: ODBC Connection

    Look at your Privacy Settings. File -> Options -> Trust Center -> Trust Center Options -> External Content. The middle radio buttons should be selected.

  5. #5
    Registered User
    Join Date
    03-08-2019
    Location
    MA
    MS-Off Ver
    2013
    Posts
    5

    Re: ODBC Connection

    There is a Data Connections and Workbook Links and both are set to the middle radio button (Prompt user).

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: ODBC Connection

    Can you post what the connection string looks like. I might be able to buy into not showing the password, but not having the user ID doesn't make sense.

    What happens when you run the query? Does it prompt you for a user name and password and does it run properly?

  7. #7
    Registered User
    Join Date
    03-08-2019
    Location
    MA
    MS-Off Ver
    2013
    Posts
    5

    Re: ODBC Connection

    Here is the connection string.
    DSN=SOTAMAS90;Description=MAS 90 4.0 ODBC Driver;Directory=E:\Data\ERP\Sage 100 Advanced v2017\MAS90;Prefix=E:\Data\ERP\Sage 100 Advanced v2017\MAS90\SY\, E:\Data\ERP\Sage 100 Advanced v2017\MAS90\==\;ViewDLL=E:\Data\ERP\Sage 100 Advanced v2017\MAS90\Home\;LogFile=\PVXODBC.LOG;RemotePVKIOHost=10.20.2.5;RemotePVKIOPort=20222;CacheSize=4;DirtyReads=1;BurstMode=1;StripTrailingSpaces=1;SERVER=NotTheServer

    Yes, it prompts for the user name and login. Also the specific company code in the software that I am using the ODBC connection with. Maybe that is why?

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: ODBC Connection

    This looks similar to an Access connection string in that it goes to a specific folder or drive. Unlike the Oracle Drivers I'm used to working with, there appears to be no place in the string where the user ID and password are stored.

    The company code is apparently a parameter for the query, so this connection string must be passing the credentials and parameters to another program that interfaces with the database. That's the program we'd have to get into.

    You can try recording a macro, but I doubt it will yield useful information. Excel most likely won't be able to "see through" to the intermediate program, but then again it might give insight on how to call it and pass parameters to it.

    I don't suppose you have a user's manual that gives command line options.

    We could possibly accomplish this with SendKeys to emulate what you would type from the keyboard, but that could be a messy solution.

    I am afraid I can't help.

  9. #9
    Registered User
    Join Date
    03-08-2019
    Location
    MA
    MS-Off Ver
    2013
    Posts
    5

    Re: ODBC Connection

    I had tried creating a macro also and it doesn't store the info either. Nothing useful in the scripting either.

    Thanks for trying. Really appreciate the efforts!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] ODBC Connection
    By j_Southern in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2016, 11:27 AM
  2. [SOLVED] Use ODBC connection without setting it up in ODBC administration
    By ExcelGal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2012, 09:59 AM
  3. ODBC Connection:
    By Miguel Martins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2012, 02:39 PM
  4. Excel VBA makes ODBC connection to Access-How do you close the connection?
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2010, 06:29 PM
  5. ODBC Connection
    By hiltonsaker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-09-2008, 10:35 PM
  6. SQL ODBC connection
    By pmguerra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2008, 11:15 AM
  7. ODBC Connection
    By Adrian T in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-25-2005, 05:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1