Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC query w/ Access and VFP

Status
Not open for further replies.

davidcreswell

Technical User
Feb 23, 2006
2
US
Hello:

I am trying to run a union query in a MS Access db with an odbc connection to vfp. The data in both tables have the same format -- they are just diffent years.

SELECT table1.vendor
FROM table1
UNION ALL
SELECT table2.vendor
FROM table2;

This should work, but I don't know why. I am getting the following msgbox.

ODBC – call failed.

[Microsoft][ODBC Visual FoxPro Driver]Syntax error. (#200)

Any help would be appreciated.

Thanks,
David
 
Thanks for the reply Mike...

Taking the semicolon out gives the same message box.

I can run each query separately, and that may be what I have to end up doing right now.

Thanks,
David
 

David,

I can run each query separately, and that may be what I have to end up doing right now.

It's a pity you have to do that. I wish I could tell you what the problem is, but the syntax looks perfectly correct to me. If you ran the command within VFP, it would work OK.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top