Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    2

    Problems with UNION-query

    I have a sql statement with 2 SELECT statements combined with the keyword UNION. Something like this

    SELECT a, b
    FROM ... WHERE ...
    UNION
    SELECT c, d
    FROM ... WHERE ...


    If i execute this in the Query Analizer everything works fine and i get the results. But if i execute this through Visual Basic (with database.OpenRecordSet(sql) ) i get following error message:

    The Microsoft Jet database engine cannot find the input table or query .... Make sure it exists and that its name is spelled correctly.

    If i execute the first part of this combined query in VB (e.g. SELECT a, b FROM ... WHERE ...), no errors occur. The same with the second part.

    I find it really strange and any hints and tips are welcome!
    thanks in advance.

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    Make sure you specify dbname..table. A different database may be your default via odbc or whatever you are using to connect through VB.

  3. #3
    Join Date
    Jun 2004
    Posts
    2
    Thx for the suggestion, but i already tried that one and unfortunately it doesn't solve the problem

    Someone other hints, tips, tricks,...?

Posting Permissions

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