error Unexpected error rom external database driver (1) (1 Viewer)

tranglt

New member
Local time
Today, 15:09
Joined
Jan 22, 2019
Messages
2
Hi,

I have about 7 tables and i try to combine them together. But i receive this error.

Anyone knows how to solve it, please tell me.

Than you so much!
error.jpg
 

Ranman256

Well-known member
Local time
Today, 04:09
Joined
Apr 9, 2015
Messages
4,339
1st, make 1 query for each :
Q1 : select * from table1
Q2 : select * from table 2
etc
test each as working.

2nd
combine all into a UNION query:

select * from Q1
union
select * from Q2
union
select * from Q3
 

isladogs

MVP / VIP
Local time
Today, 09:09
Joined
Jan 14, 2017
Messages
18,209
Never seen that error before.
Agree about testing each part separately.
If you prefer just paste each part separately into a query sql view.
If it works, use as part of a new union query.

No need to make each part into a saved query unless you want to do so.
 

JHB

Have been here a while
Local time
Today, 10:09
Joined
Jun 17, 2012
Messages
7,732
I would rename the tables to names that isn't the same as the linked Excel sheets.
 

tranglt

New member
Local time
Today, 15:09
Joined
Jan 22, 2019
Messages
2
I tested each separately and it worked.

and i also combined Q1, Q2, Q3 into a union query, it worked, too.

But if i combined about 5Q, error "Unexpected error from external data driver (1)" appears
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:09
Joined
Feb 28, 2001
Messages
27,140
First question: What is your physical configuration? To see an "external database" error I would expect you are looking at linked tables. Linked to what? SQL? Excel? DB2? Something that does ODBC?

Second question: How many records do you expect this query to return AND how many fields? When I look up problems with UNION queries, they seem to have some sort of limit based on the combination of the number of tables and the number of fields per table. Sort of like it is the product of the tables times the fields, or it might be the product of the tables times the total field length per record. Something like that. So I am suspicious that you are running into one of "those" errors and the table's host cannot manage whatever it is that you are doing.

Third question: In order to be able to do repetitive SELECT * FROM tableN and then UNION them, that says that EVERY TABLE is structured identically because the fields have to match up exactly to do that. Is that set of identical structures the case?

Because if it is, your REAL solution is to build a SINGLE TABLE that exactly matches the structure of the other tables, then do seven (or however many is needed) INSERT INTO singletable (a,b,c...) SELECT a,b,c,.. FROM tableN queries. Then you need no UNION queries at all. AND if they really ARE identical, you create that query for the first insert, then edit the "FROM" table-name to pick up each source table. One-time operation, should be a piece of cake.
 

Users who are viewing this thread

Top Bottom