Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002

    Unanswered: ADO Connection and linked tables


    I'm trying to run a routine from Excel that populates a spreadsheet by creating an ADODB connection to an Access database and opening an exsting query.

    This query contains a couple of tables that are linked into the Access database from other databases.

    When I run the routine I get the error message "Too few paramaters. Expected 1". Interestingly if I try to run the routine locally or against tables that aren't linked tables, then it works OK.
    I've also tried DAO with the same result.

    Anyone know if there are any problems with ADO or DAO connections when the tables being used are actually linked tables?

    I know the above way of doing things isn't the best and it would be easier to produce the spreadsheet from the Access database, but it seems that thats the way they want things round here...

    Any thoughts appreciated.

  2. #2
    Join Date
    Apr 2004
    Derbyshire, UK
    Provided Answers: 1

    Use this technique all the time (with ADO) and have had no problems (I coudn't fix!), almost all errors with that message I encounter are errors in the query string.

    However, I normally connect to the backend (its faster) and define the query string in Excel.

    How is the recordset opened in Excel, for instance is it

    rs.Open "qryYourQuery", connection

    or somthing like

    rs.Open "SELECT * FROM qryYourQuery WHERE FieldName = xxx", connection

    In either case what is the query stored in the DB, does it have parameters?


  3. #3
    Join Date
    Nov 2002
    Hi Mike - thanks for the reply.

    After I posted originally I went back and re-examined the query, and realised that there was a significant field missing. The query was composed of other queries, so the error was slightly hidden, but I should have spotted it.

    I think part of the problem was that I was told to have a look at this, and that the problem was to do with the linked tables....should have examined everything myself from the start.

    Thanks for your reply, it certainly helped.


Posting Permissions

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