+ Reply to Thread
Results 1 to 5 of 5

SQL links.

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    SQL links.

    I have four tables on a worksheet each loaded by an ODBC link originated using MSQuery.

    The code I use follows
    Please Login or Register  to view this content.
    This works for the first two tables, but not the others.
    If I rightclick the designated cell (and I am sure the offsets are right) then I can refresh all four tables.
    I think my code must be wrong but I can't see where.
    Can any one help?
    John

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: SQL links.

    If you comment out the On Error Resume Next line, what happens?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: SQL links.

    xlnitwit,
    Thanks for your interest.
    What happens is that on some queries, but not all, I get a message "Authorisation Error".
    It is true that when I perform a "Right Click Refresh" manually, I am asked for the SQL password. This is why I have the line Application.DisplayAlerts = False as I don't want my users to have enter a password four times in a row.
    All the queries are fundamentally the same, selecting data from a combination of up to three tables in a SQL database. So it is difficult to understand why they react differently to the same code.
    John

  4. #4
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: SQL links.

    Is it possible to code in a password if one is needed to gain access by MSQuery to a SQL or other Data Base?
    John

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: SQL links.

    It is possible when setting up the query to save the password with it, which is what I assume has been done with the queries that do not prompt you.

+ 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. Replies: 1
    Last Post: 08-26-2016, 05:06 PM
  2. Store all external links in an array and then replace all links with an empty string
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-17-2016, 03:32 PM
  3. Completely remove/delete all the external links (Break Links)
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2014, 05:31 AM
  4. Replies: 32
    Last Post: 07-23-2013, 01:14 AM
  5. Replies: 1
    Last Post: 01-06-2012, 12:31 PM
  6. Replies: 2
    Last Post: 10-23-2010, 08:36 AM
  7. [SOLVED] EXCEL - LINKS cannot easily get list of all links & names in book
    By Tuba Joe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-29-2005, 06:05 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