View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David Weilmuenster[_2_] David Weilmuenster[_2_] is offline
external usenet poster
 
Posts: 3
Default Excel 2002 Macro to Execute SQL Statement

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