ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automating Access from Excel (https://www.excelbanter.com/excel-programming/329184-automating-access-excel.html)

quartz[_2_]

Automating Access from Excel
 
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.

Andy Wiggins[_5_]

Automating Access from Excel
 
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



"quartz" wrote in message
...
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.




quartz[_2_]

Automating Access from Excel
 
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!

"Andy Wiggins" wrote:

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



"quartz" wrote in message
...
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.






All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com