ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Connecting to Access Database from Excel (https://www.excelbanter.com/excel-programming/383518-connecting-access-database-excel.html)

Feifei

Connecting to Access Database from Excel
 
Hi - I'm tring to open an Access 2003 database from Excel 2003 and append a
range of Excel cell values into an existing table.

When I try to declare the connection variable, I got a compiler error for
"user-defined type not define" for

Dim Conn As New ADODB.Connection

Is there anything else I need to do before declaring the connection variable?

Thanks!

Feifei


Tom Ogilvy

Connecting to Access Database from Excel
 
In Excel,
have you created a reference in the VBE in tools = Referneces to the ADODB
reference library?

--
Regards,
Tom Ogilvy


"Feifei" wrote:

Hi - I'm tring to open an Access 2003 database from Excel 2003 and append a
range of Excel cell values into an existing table.

When I try to declare the connection variable, I got a compiler error for
"user-defined type not define" for

Dim Conn As New ADODB.Connection

Is there anything else I need to do before declaring the connection variable?

Thanks!

Feifei


Feifei

Connecting to Access Database from Excel
 
I actually just found that out right after I post the question. Knew it
would have been a really quick fix. Thanks!

"Tom Ogilvy" wrote:

In Excel,
have you created a reference in the VBE in tools = Referneces to the ADODB
reference library?

--
Regards,
Tom Ogilvy


"Feifei" wrote:

Hi - I'm tring to open an Access 2003 database from Excel 2003 and append a
range of Excel cell values into an existing table.

When I try to declare the connection variable, I got a compiler error for
"user-defined type not define" for

Dim Conn As New ADODB.Connection

Is there anything else I need to do before declaring the connection variable?

Thanks!

Feifei



All times are GMT +1. The time now is 08:04 AM.

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