Type 'OleDbConnection' no define

B

bokiteam

Hi All,

I have this error msg, but I have already import lib, could you please
advice?

Imports System.Data.OleDb
Public Class Form1 Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
....
Error msg:
Type 'OleDbConnection' no define
Type 'OleDbCommand' no define
Type 'OleDbDataReader' no define

Thank you veyr much!
Best regards,
Boki.
 
B

bokiteam

Hi Aaron,

Do you mean remove " Inherits System.Windows.Forms.Form" ??

I am not familiar with VB.NET, I need your more description.

Best regards,
Boki.
 
C

Cor Ligthert [MVP]

Boki,

Strange, can you try to describe it as this to see what happens.
Dim cn As System.Data.OleDb.OleDbConnection
Dim cmd As System.Data.OleDb.OleDbCommand
Dim dr As System.Data.OleDb.OleDbDataReader
...

Your code should not give an error in my opinion.

Cor
 
B

bokiteam

I will get error when I add this line:

Imports System.Data.OleDb

Did I miss some LIB or?

Best regards,
Boki.
 
C

Cor Ligthert [MVP]

Boki,

You can see that in your solution explorer at resources.

If it is not there you can rightclick on that and than Add Reference and
follow the box that you see or use Project Add Resources.

I hope this helps,

Cor
 
B

bokiteam

Hi,
I can read a MS ACCESS file in WIN32 app project, but I failed on WINCE
project.

Q1. First, I want to read/write MS ACCESS file in WINCE, it works only
on WIN32 app project now... ( if I want to read MS ACCESS file, I still
have to inlcude "System.Data.Sqlserverce.dll"? )

Q2. I want to read/write SQL data, so what I have to do is include
"System.Data.Sqlserverce.dll" ? and then I will have the most
functions?

Thank you so much for your advice for newbie.

Best regards,
Boki.
 

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