Re: Stumped by Union Query
- From: "Baz" <bazz@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Jul 2007 14:54:56 +0100
Error 3146 means that MySQL has generated an error, not Access. It's
impossible to tell from the Access SQL what the MySQL ODBC driver has done
(unless anyone around here has intimate knowledge of the thing, which is
unlikely). Your mission is to find out exactly what SQL actually arrives at
the MySQL server, and what is wrong with it, and for that you need to be
asking MySQL experts.
"Biz Enhancer" <BizEnhancer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:46177743-08B7-4D1E-A315-C63B00902793@xxxxxxxxxxxxxxxx
Hello learned guru's, boffins and hackers,(((clientsub.clisid)=[Forms]![rclient]![List51]))
I have a perplexing problem.
The object of the exercise is to transpose the fields of one record into a
listbox. Using a UNION query I am able to get two SELECT queries into the
listbox but when I add more I get an" ODBC - call failed" error.
Listbox.rowsource =
SELECT clientsub.clisid, "First Name: " AS f1, [Fname] AS f2, "Fname" AS
flit FROM clientsub WHERE
UNIONflit
SELECT clientsub.clisid, "Last Name: " AS f1, [Lname] AS f2, "Lname" AS
FROM clientsub WHERE (((clientsub.clisid)=[Forms]![rclient]![List51]))AS
UNION
SELECT clientsub.clisid, "Position: " AS f1, [Position] AS f2, "Position"
flit FROM clientsub WHERE(((clientsub.clisid)=[Forms]![rclient]![List51]))
UNIONAS
SELECT clientsub.clisid, "Location: " AS f1, [Location] AS f2, "Location"
flit FROM clientsub WHERE(((clientsub.clisid)=[Forms]![rclient]![List51]))
UNION(((clientsub.clisid)=[Forms]![rclient]![List51]))
SELECT clientsub.clisid, "Work Phone: " AS f1, [Wphone] AS f2, "Wphone" AS
flit FROM clientsub WHERE
UNIONAS
SELECT clientsub.clisid, "Mobile Phone: " AS f1, [mphone] AS f2, "mphone"
flit FROM clientsub WHERE(((clientsub.clisid)=[Forms]![rclient]![List51]))
UNIONthird
SELECT clientsub.clisid, "Email: " AS f1, [Email] AS f2, "Email" AS flit
FROM clientsub WHERE (((clientsub.clisid)=[Forms]![rclient]![List51]));
Any two SELECT statements joined with a UNION work fine, however add a
and the failure occurs.
Access 2003 linked via MySQL ODBC 3.51 driver into MySQL Server 5.0.21
I can not figure out why the error is occuring. Can anyone shed some light
on this problem?
Thanks in advance
Nick.
.
- Follow-Ups:
- Re: Stumped by Union Query
- From: Biz Enhancer
- Re: Stumped by Union Query
- Prev by Date: Re: Update Query based on a value between two fields
- Next by Date: Need query to return absence of record
- Previous by thread: Re: Excluded Results from a join
- Next by thread: Re: Stumped by Union Query
- Index(es):
Relevant Pages
|