Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Database

Posted on 2004-10-05
7
Medium Priority
?
258 Views
Last Modified: 2012-05-05
How do I connect, read and display the contents of a Access database ie: file.mdb
Thanks
0
Comment
Question by:Mylor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 16

Expert Comment

by:RobertRFreeman
ID: 12228414
Use the data form wizard project.

From your solution add a new data form project.  It will prompt you for all the settings.
0
 
LVL 16

Expert Comment

by:RobertRFreeman
ID: 12228432
sorry,

From your VB Project, add a new data form wizard item.
0
 
LVL 16

Expert Comment

by:RobertRFreeman
ID: 12228453
Use Microsoft Jet 4.0 for your provider when setting up the connection.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
bramsquad earned 1000 total points
ID: 12228561
   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
 

Author Comment

by:Mylor
ID: 12228615
Hi Bramsquad, what reference do I need to import?
Thanks,
0
 
LVL 4

Expert Comment

by:srcalc
ID: 12229034
System.Data.OleDb
0
 

Author Comment

by:Mylor
ID: 12229063
Thanks !
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question