467,075 Members | 968 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,075 developers. It's quick & easy.

UNION statement doesn't work


Hi,

I have a database stored in MS SQL 2000 and an application written in
VB5, which connects the database via JET/ODBC.

I have a problem with the UNION statement.

When I run a simple query like:

"SELECT field1 FROM table1 UNION SELECT field2 FROM table2"

I get the following error:

"Runtime error 3078 - The Microsoft Jet database engine cannot find the
input table or query 'select field1 from table1'. Make sure it exists
and that its name is spelled correctly."

I can run the queries separately "SELECT field1 FROM table1" and "SELECT
field1 FROM table2", so that I'm sure table and field names are correct
and I have permission to access them.

Both field1 and field2 are the same type (int).

If I run the query in MS SQL Query Analyzer, it works fine.

It doesn't work only when I run it from VB/JET/ODBC.

Has anyone already had this kind of problem?

Any help will be highly appreciated!

Thank you so much for the attention.
--
Posted via http://dbforums.com
Jul 20 '05 #1
  • viewed: 4473
Share:
1 Reply

"loRdK" <me*********@dbforums.com> wrote in message
news:33****************@dbforums.com...

Hi,

I have a database stored in MS SQL 2000 and an application written in
VB5, which connects the database via JET/ODBC.

I have a problem with the UNION statement.

When I run a simple query like:

"SELECT field1 FROM table1 UNION SELECT field2 FROM table2"

I get the following error:

"Runtime error 3078 - The Microsoft Jet database engine cannot find the
input table or query 'select field1 from table1'. Make sure it exists
and that its name is spelled correctly."

I can run the queries separately "SELECT field1 FROM table1" and "SELECT
field1 FROM table2", so that I'm sure table and field names are correct
and I have permission to access them.

Both field1 and field2 are the same type (int).

If I run the query in MS SQL Query Analyzer, it works fine.

It doesn't work only when I run it from VB/JET/ODBC.

Has anyone already had this kind of problem?

Any help will be highly appreciated!

Thank you so much for the attention.


Isn't Jet Access related? Are you sure the database is SQL Server? If so, is
your ODBC DSN defined correctly?

Ron.
--
Performance Intelligence, Inc.
Spy 4 DB2 - http://www.pireporting.com/spy4db2.html

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Thomas Baxter | last post: by
3 posts views Thread by Paradigm | last post: by
4 posts views Thread by Elroyskimms | last post: by
7 posts views Thread by urban.widmark@enlight.net | last post: by
8 posts views Thread by wkaras@yahoo.com | last post: by
7 posts views Thread by KoliPoki | last post: by
2 posts views Thread by jafastinger@aep.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.