Automating Access from Excel

G

Guest

I am using Office 2003 on Win XP with ADO 2.8 Object Library and ADO ext 2.8
for DLL and Security. Also have a ref to Access object library.

I know it is possible to create a table in Access from Excel by using ADOX.

Is it possible to create a table in Access from Excel by defining the table
in SQL?
Then deliver the SQL using the ADO execute method. I thought that you could
and that somewhere I had done it.

I am trying the following syntax without luck:
CREATE TABLE tablename (field1 VARCHAR NULL, field2 VARCHAR NULL)

Can someone please correct my SQL or otherwise refresh my memory on this?
Thanks in advance.
 
A

Andy Wiggins

This might be a help for getting data to and from Excel and Access: It
includes examples of using variables in SQL queries.
http://www.bygsoftware.com/examples/sql.html

Or you can get there from the "Excel with Access Databases" section on page:
http://www.bygsoftware.com/examples/examples.htm

It demonstrates how to use SQL in Excel's VBA to:

* create a database,
* create a table
* insert records
* select records,
* update records,
* delete records,
* delete a table,
* delete a database.

DAO and ADO files available.

You can also download the demonstration file called "excelsql.zip".

The code is open and commented.


--
Regards
-
Andy Wiggins FCCA
www.BygSoftware.com
Excel, Access and VBA Consultancy
 
G

Guest

Thanks Andy!
Actually I got my code running - it was a syntax thing.
But, I like your site very much and I'm finding other tips that are very
helpful.
Thanks a lot!
 

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