Solved

ODBC and Union Queries

Posted on 2001-07-23
9
621 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

856 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