?
Solved

Access Database

Posted on 2004-10-05
7
Medium Priority
?
254 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 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