Solved

ODBC and Union Queries

Posted on 2001-07-23
9
628 Views
Last Modified: 2008-02-01
Ok, I have 3 tables  1) New, 2) Current, and 3) History.  All 3 have identical data structures.  I am trying to do a Union query in Access, but I get the following error:

ODBC--call failed.
[Timberline][Timberline ODBC Dri(#0)[Timberline][Timberline ODBC Driver](#0)

The funny thing is I can get the query to work fine in Crystal Reports SQL Query Designer.  I have tried to restart everything, kicked everyone out of the DB, Refreshed the links to the Timberline tables, yet nothing works.  Any ideas?  Below is my code, notice how terribly basic it is...

SELECT *
FROM NEW_GLT_TRANSACTION

UNION SELECT *
FROM HISTORY_GLT_TRANSACTION
0
Comment
Question by:Uziel
9 Comments
 
LVL 8

Expert Comment

by:dovholuk
ID: 6309499
-instead of using *, have you tried replacing it with the actual field names???
-i assume the ODBC driver is the "latest", correct?

just some thoughts...

dovholuk
0
 
LVL 1

Author Comment

by:Uziel
ID: 6309517
Yes, I started with just one field name and reverted to the * hoping it would alleviate any errors.

What is weird is that it DID work...once.  Then I started changing it to exactly what I wanted and stopped working.  It makes no sense.  Also, it does work in Crystal SQL, just not access.
0
 
LVL 1

Author Comment

by:Uziel
ID: 6309518
Yes, I started with just one field name and reverted to the * hoping it would alleviate any errors.

What is weird is that it DID work...once.  Then I started changing it to exactly what I wanted and stopped working.  It makes no sense.  Also, it does work in Crystal SQL, just not access.
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 8

Expert Comment

by:dovholuk
ID: 6309878
ok. we'll put it to the test then! :)

i am assuming that your query is based off of "linked" tables, right?  instead, use a passthrough query. passthrough queries are run DIRECTLY against the server with no (very little) Access manipulation.

if you need help with creating a passthrough query, let me know. otherwise, try that and see what happens.

dovholuk
0
 
LVL 1

Author Comment

by:Uziel
ID: 6309959
I've never done a pass through, and the documentation is not very good.  Any chance I could get an example to run off?  I'm assuming this will allow me to plug the information where I want it, but will it let me do a union as well?

Btw, thanks so much for the help.
0
 
LVL 6

Accepted Solution

by:
devtha earned 83 total points
ID: 6340673
Just change the query typr to pass thru from the query menu and selecting SQL specific .
0
 
LVL 8

Expert Comment

by:dovholuk
ID: 6341875
devtha is mostly correct. you need to be careful with your syntax when running a passthrough query as you will need to use ansi sql as opposed to access sql. so getting the syntax just right might take effort.

but to try it out, you create a new query. go to the query menu, choose "Sql specific" and then choose "pass-through".  you will be forced to TYPE in your sql, so as a trial try something like "SELECT * FROM SomeTableName" and then run the query to see if it works.

oh yes, union is an ansi sql command, so that should work fine...

good luck, let us know if you need any more help.

dovholuk
0
 

Expert Comment

by:amp072397
ID: 6784031
Uziel:

You have several open questions:

http://www.experts-exchange.com/jsp/qShow.jsp?qid=20155619
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20113753
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20104730

To assist you in your cleanup, I'm providing the following guidelines:

1.  Stay active in your questions and provide feedback whenever possible. Likewise, when feedback has not been provided by the experts, commenting again makes them receive an email notification, and they may provide you with further information. Experts have no other method of searching for questions in which they have commented, except manually.

2.  Award points by hitting the Accept Comment As Answer button located above and to the left of that expert's comment.

3.  When grading, be sure to read:
http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp#3
to ensure that you understand the grading system here at EE. If you grade less than an A, you must explain why.

4.  Questions that were not helpful to you should be PAQ'd (stored in the database for their valuable content?even if not valuable to you) or deleted. To PAQ or delete a question, you must first post your intent in that question to make the experts aware. Then, if no experts object after three full days, you can post a zero-point question at community support to request deletion or PAQ. Please include the link(s) to the question(s).
CS:  http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
At that point, a moderator can refund your points and PAQ or delete the question for you. The delete button does not work.

5.  If you fail to respond to this cleanup request, I must report you to the Community Support Administrator for further action.

Our intent is to get the questions cleaned up, and not to embarrass or shame anyone. If you have any questions or need further assistance at all, feel free to ask me in this question or post a zero-point question at CS. We are very happy to help you in this task!


thanks!
amp
community support moderator

1/7
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6958395
Per recommendation, force-accepted by
Netminder
CS Moderator

dovholuk: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=msaccess&qid=20290223
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question