Excel 2002 Macro to Execute SQL Statement

D

David Weilmuenster

Hi, I'm trying to write a macro in Excel 2002 to execute
the following (example) SQL statement:

insert into `C:\Documents and
Settings\User\Desktop\Test`.`Master$` (Apples, Pears,
Oranges,Store)
SELECT `Update$`.Apples, `Update$`.Pears,
`Update$`.Oranges, `Update$`.Store
FROM `C:\Documents and
Settings\User\Desktop\Test`.`Update$` `Update$`

The macro would run from inside the test.xls spreadsheet
which has already been defined as an ODBC Data Source. I
know that the SQL statements are correct, because I can
manually enter them into MS Query from inside Excel and
get the desired result.

I've tried reading the MS Visual Basic help for this, but
it's far above my expertise.

Any clues/suggestions would be much appreciated.

Thanks,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top