Newbie question on OleDbConnection

  • Thread starter Thread starter Richard Lu
  • Start date Start date
R

Richard Lu

Hi all,

In VB.NET I want to use access MS MDB database, and use following code.

....
Dim myConnection As OleDbConnection
....

But the compiler warns me that 'undefined type OleDbConnection', is there
anything missing?
 
Richard said:
Hi all,

In VB.NET I want to use access MS MDB database, and use following code.

...
Dim myConnection As OleDbConnection
...

But the compiler warns me that 'undefined type OleDbConnection', is there
anything missing?

Make sure that System.Data.dll is included in the project's References
(it will be by default).

Make sure you have this statement

Imports System.Data.OleDb

at the start of each code file that uses OleDb objects. Or add
System.Data.OleDb to the global Imports list for the project (in
project properties).
 
Done, thanks Larry.
Larry Lard said:
Make sure that System.Data.dll is included in the project's References
(it will be by default).

Make sure you have this statement

Imports System.Data.OleDb

at the start of each code file that uses OleDb objects. Or add
System.Data.OleDb to the global Imports list for the project (in
project properties).
 

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

Back
Top