Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

Access Database

How do I connect, read and display the contents of a Access database ie: file.mdb
Thanks
0
Mylor
Asked:
Mylor
1 Solution
 
RobertRFreemanCommented:
Use the data form wizard project.

From your solution add a new data form project.  It will prompt you for all the settings.
0
 
RobertRFreemanCommented:
sorry,

From your VB Project, add a new data form wizard item.
0
 
RobertRFreemanCommented:
Use Microsoft Jet 4.0 for your provider when setting up the connection.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
bramsquadCommented:
   Dim conn As OleDbConnection
    Dim adpt As OleDbDataAdapter

    Dim cstring, sql As String

    'connect
    cstring = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=C:\The\Path\To\File.mdb;"
    sql = "SELECT * FROM YourFavoriteTable;"

    conn = New OleDbConnection(cstring)
    adpt = New OleDbDataAdapter(sql, conn)
    adpt.Fill(ds, tblName)    

    'read and display in a datagrid
    dgTable.DataSource = ds.Tables("YourFavoriteTable").DefaultView
    dgTable.Refresh()

~b
0
 
MylorAuthor Commented:
Hi Bramsquad, what reference do I need to import?
Thanks,
0
 
srcalcCommented:
System.Data.OleDb
0
 
MylorAuthor Commented:
Thanks !
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now