Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to connect to Access using VB.net

Posted on 2004-04-12
5
Medium Priority
?
1,425 Views
Last Modified: 2007-12-19
Hi
  Could someone advise me on how I could connect to an Access database using a datasource with VB.Net and create a recordset.

Any help is greatly appreciated
thanx
0
Comment
Question by:b3cf
[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
5 Comments
 
LVL 8

Accepted Solution

by:
gregasm earned 200 total points
ID: 10809086
Look here, this is a useful guide to creating a connection and accessing data in vb.net with ADO.NET managed oledb provider.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskcreatingconnectiontoaccessdatabase.asp
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 10809092
Dim MyConn as OleDbConnection
Dim ConnStr as String
ConnStr=""Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\MyApp\MyDataBase.mdb"

MyConn= new OleDbConnection(ConnStr)
If u have database Protected with Userid add "Userid=xxxx;Password=xxxxx" to the above string

Once Connection is Opened other opearations are same as common OleDb operations
0
 
LVL 3

Expert Comment

by:monkesdb
ID: 10809102

    Dim rs As New ADODB.Recordset
   
    rs.Source = "SELECT * FROM Table"
    rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""C:\dir\db.mdb"""
    rs.Open
0

Featured Post

Implementing Azure Infrastructure Exam 70-533

This course is designed to familiarize and instruct students in the content that is covered by Microsoft Exam 70-533, Implementing Microsoft Azure Solutions. It focuses on all the November 2016 objective domain topics.

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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