Solved

Access Database

Posted on 2004-10-05
7
251 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 8

Accepted Solution

by:
bramsquad earned 250 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

Industry Leaders: 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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 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