PDA

View Full Version : Excel procedure to run Access Query using ADO



alienscript
09-05-2007, 09:21 AM
Hello the VBA expert,

I am able to use ADO method in Excel procedure to look up for information in Access and export the data back to the same sheet in Excel. I saved the xls and mdb files in C:\Data\

My problem is when I run the procedure the second time, it append the data to the Table "refTable1". I created a delete query named "delete_refTable1". I need help how to run this saved query before it will continue to copy the Excel to the Table "refTable1". Can someone please help. Thanks in advance.

rory
09-05-2007, 09:25 AM
If you have an ADO connection established, you should just be able to use:
conn.Execute "delete_refTable1"

alienscript
09-05-2007, 10:15 AM
Thanks Rory. I use cn.Execute