There is no direct connection between VBA and SQL, but...
You can use components to access databases and depending on the
drivers/providers used, UNION and other SQL features may or may not be
available.
I'm not familiar with DBF files, so I can't say, but you start by looking at
ADO (or possibly DAO).
Maybe one/some of these will help
http://www.google.co.uk/search?hl=en...e+Search&meta=
NickHK
"sharon" wrote in message
...
Thanks for your answer.
Do you think in VBA is the same?
TIA,
"NickHK" wrote:
AFAIK MSQuery does not support a UNION.
NickHK
"sharon" wrote in message
...
I am writting a SQL sentence in msQuery and it says "Impossible to add
(SELECT table", in the next sentence:
SELECT id_User,id_PC,vTime FROM (SELECT 1 AS PC_new.id_User
`c:\PC_office`\PC_new.DBF PC_new UNION ALL SELECT 2 AS PC_old.id_User
`c:\PC_office`\PC_old.DBF PC_old)
WHERE id_User Like 'TED%'
Is it possible to do in Excel? What's wrong in my sentence?
Any idea?