Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004
    Posts
    25

    Unanswered: Querying non-linked table

    I am trying to connect to a MYOB (.DAT) table using the ODBC driver. I do not want to link the table to the main database I would simply like to query it.
    What I have done so far is to create a query with the 'Source Connect Str' set to "ODBC;DSN=MYOB;;TABLE=MYOB.Items", and added the table and field I want to query. The SQL created is this:

    SELECT MYOB.Items.ItemName
    FROM MYOB.Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];

    Running this query, will ask for the parameter MYOB.Items.ItemName what ever I enter will be displayed for the number of records that are in the table. The amount of records its displaying is the same as there is supposed to be but the data is not the same. If anyone has any ideas I would be much appreciative.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I dont even know what MYOB is but suspect the sql is malformed, cant be defintive because its so long since I've had the need to extract from an ODBC connection

    SELECT MYOB.Items.ItemName
    FROM MYOB.Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];

    possibly should read

    SELECT ItemName
    FROM Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];
    OR
    SELECT Items.ItemName
    FROM Items IN '' [ODBC;DSN=MYOB;;TABLE=MYOB.Items];

Posting Permissions

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