Click here to Skip to main content
14,733,542 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Im new to VB. In delphi it was simple to read a mdb file
I added an "ado query" and a table. Linked them together.
The code i used was := false
ado.sql.text := "select * from table" := true

It was 3 lines of code to read a database and put it into a table.

Is there no simple method like this to open a mdb file in vb?

If you look back at your delphi work it wasn't quite that simple - you had to specify the DB, and set up a connection as well.
It is the same with VB:
Using con As New SqlConnection(strConnect)
	Using da As New SqlDataAdapter("SELECT * FROM myTable", con)
		Dim dt As New DataTable()
		myDataGridView.DataSource = dt
	End Using
End Using
That not only fills a table, but also displays it as well...
You need to use ADO.NET classes to read data from access
Some useful classes r as folows

Check this link[^]

Best of luck........

For reading Access file from VB.NET code, see the following link:[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900