Microsoft Access is still one of the most common databases BSIT and BSCS students use for their capstone projects, and connecting it to a VB.NET front end is still one of the most-asked-about workflows. The combo is fast to prototype, free with Office, and runs on any Windows lab machine. This 2026 tutorial walks you through every step: setting up the .accdb file, building the right OleDb connection string, performing full CRUD (Create, Read, Update, Delete), binding results to a DataGridView, and fixing the four or five errors every student hits the first time.
📥 Working sample (free download): Skip ahead and grab a complete VB.NET + Access tutorial project as a single ZIP, CONNECTVBACCESS.zip. Includes the .accdb file, the VS solution, and all the CRUD code from this guide ready to open in Visual Studio 2017 or newer.
Things changed quietly between 2024 and 2026. Visual Studio 2022 is now the stable baseline (Visual Studio 2026 is in preview), .NET 8 is the current LTS runtime, and the Microsoft Access Database Engine 2016 Redistributable is still the file you need to install on machines that don’t have Office. The Provider string most tutorials show, Microsoft.ACE.OLEDB.12.0, still works, but the modern correct version is Microsoft.ACE.OLEDB.16.0 for Access 2016+ and Office 365. We’ll cover both.
Last updated: June 2026, by PIES Information Technology Solutions. Tested on Visual Studio 2022 Community (17.12) with .NET 8, Microsoft Access 365, and Access Database Engine 2016 Redistributable on Windows 11. Audience: BSIT/BSCS capstone students using VB.NET as their front-end stack.
📌 TL;DR: To connect an MS Access database (.accdb) to VB.NET in 2026, use System.Data.OleDb with the Microsoft.ACE.OLEDB.16.0 provider. Connection string template: Provider=Microsoft.ACE.OLEDB.16.0;Data Source=path\to\db.accdb;, then open with conn.Open() inside a Try/Catch. For older .mdb files use Microsoft.Jet.OLEDB.4.0 (32-bit only). The single biggest gotcha: your Office bitness (32-bit vs 64-bit) must match your VB.NET project’s target platform, or you’ll get “provider not registered on the local machine”.
Prerequisites
Before you write a single line of code, make sure your machine has:
- Visual Studio 2022 Community (free) with the .NET desktop development workload installed. Visual Studio 2026 preview also works if you’re on it; the steps are identical.
- .NET Framework 4.8 for classic VB.NET WinForms projects, or .NET 8 (Windows Forms App) for modern .NET. OleDb works on both.
- Microsoft Access 2016 or later (Office 365 / Microsoft 365 included). You need this to create the .accdb file, but the runtime that connects to it can be installed separately (see next item).
- Microsoft Access Database Engine 2016 Redistributable: required on any machine that doesn’t have Office installed. Download from Microsoft’s site. Pick the bitness that matches your VB.NET target: x86 for 32-bit projects, x64 for 64-bit. Installing both at the same time is supported as of the 2016 version but requires the
/quietflag, single-version install is simpler. - Basic VB.NET knowledge: you should be comfortable with WinForms, event handlers, and Try/Catch. If you’re brand new to VB.NET, start with our VB.NET tutorial series first, then come back.
Setting Up Your Access Database
Open Microsoft Access and create a new Blank database. Name it students.accdb and save it somewhere you’ll remember, for this tutorial we’ll use C:\VBProjects\students.accdb. Avoid saving it directly under C:\Program Files or anywhere that requires admin rights to write (Access needs to update lock files when the database is open, and read-only folders will trigger the dreaded “Operation must use an updateable query” error later).
Create a table called tblStudents with these fields:
StudentID, AutoNumber, Primary KeyFullName, Short Text (255)Course, Short Text (50)YearLevel, Number (Integer)EnrollmentDate, Date/Time
Save and close the database file before moving to VB.NET. Access locks the file while it’s open in design mode, and your VB.NET app will fail to connect until you close Access. Add one or two test rows manually so you have data to query.
(Screenshot placeholder: Access table design view showing tblStudents fields.)
Step A: Create the database table
Open Microsoft Access on your computer, create a Blank Database and save it as inventorydb.accdb. Then create a table and save it as tblitems with the columns shown below.

Step B: Populate the table with sample records
Add a few sample rows so you have something to read back from your VB.NET app. The exact data does not matter, just match the column types.

Step C: Design the VB.NET form
Open Visual Studio, create a new Visual Basic Windows Forms App, and save it as connectvbaccess. Drop a few TextBoxes, Buttons, and a DataGridView onto the form, like the layout below.

Step 1: Add OleDb Reference to Your VB.NET Project
Open Visual Studio 2022 and create a new Windows Forms App (.NET Framework) or Windows Forms App (.NET 8). Either is fine. Name the project StudentManager.
In Solution Explorer, right-click References (for .NET Framework) or Dependencies (for .NET 8) and confirm System.Data is listed, it is by default in WinForms templates. You don’t need to add a separate NuGet package for OleDb on .NET Framework. For .NET 8 / .NET Core, you do, install the System.Data.OleDb NuGet package:
' Package Manager Console
Install-Package System.Data.OleDb
' Or via .NET CLI
dotnet add package System.Data.OleDbThen add this Imports statement at the top of your form’s code-behind file:
Imports System.Data.OleDbThat single import gives you access to OleDbConnection, OleDbCommand, OleDbDataReader, OleDbDataAdapter, and OleDbParameter, everything you need for the rest of this tutorial.
Step 2: Building the Connection String
The connection string is where most students get tripped up. It has two essential parts: the Provider (which OLE DB driver to use) and the Data Source (path to the .accdb or .mdb file).
For .accdb files (Access 2007+), the modern way in 2026:
Dim connString As String = _
"Provider=Microsoft.ACE.OLEDB.16.0;" &
"Data Source=C:\VBProjects\students.accdb;"If you don’t have the 16.0 driver yet, Microsoft.ACE.OLEDB.12.0 also works and ships with the older Access Database Engine 2010 Redistributable. Use 16.0 for any new project, it’s the version Microsoft actively maintains.
For older .mdb files (Access 97-2003):
Dim connString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" &
"Data Source=C:\VBProjects\students.mdb;"Important: Microsoft.Jet.OLEDB.4.0 is 32-bit only. If your VB.NET project is set to “Any CPU” and runs as 64-bit on a 64-bit Windows install, Jet will fail to load. Either set your project’s Platform target to x86, or convert the database to .accdb and use ACE.
If your database has a password:
Dim connString As String = _
"Provider=Microsoft.ACE.OLEDB.16.0;" &
"Data Source=C:\VBProjects\students.accdb;" &
"Jet OLEDB:Database Password=MyPass123;"⚠️ The 32-bit vs 64-bit gotcha: The bitness of your installed Access Database Engine must match the bitness your VB.NET process runs as. If your project’s Platform target is x86, install the 32-bit redistributable. If it’s x64 or “Any CPU” on 64-bit Windows, install the 64-bit redistributable. Mismatch = “The ‘Microsoft.ACE.OLEDB.16.0’ provider is not registered on the local machine.” Fix it by changing the Platform target (Project → Properties → Build → Platform target) or by installing the other bitness.
Step 3: Opening and Closing the Connection
Always wrap connection code in a Try/Catch/Finally. The Finally block guarantees the connection closes even if something throws, which prevents Access from leaving lock files lying around:
Dim conn As New OleDbConnection(connString)
Try
conn.Open()
MessageBox.Show("Connection successful!")
Catch ex As OleDbException
MessageBox.Show("Database error: " & ex.Message)
Catch ex As Exception
MessageBox.Show("Unexpected error: " & ex.Message)
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
End If
End TryA cleaner pattern is the Using block, which auto-disposes the connection (and closes it) at the end of the scope. This is the preferred style in modern VB.NET:
Using conn As New OleDbConnection(connString)
conn.Open()
' Do work here: conn is closed automatically when the Using block exits
End Using
Step 4: Full CRUD Operations
Every database app does the same four things: Create (INSERT), Read (SELECT), Update, and Delete. Here’s the complete pattern for each one, all using parameterized commands to prevent SQL injection. Always parameterize, even on a “local” capstone app. It’s a one-line discipline that protects you for life.
Create (INSERT)
Private Sub AddStudent(fullName As String, course As String, year As Integer)
Dim sql As String = "INSERT INTO tblStudents " &
"(FullName, Course, YearLevel, EnrollmentDate) " &
"VALUES (?, ?, ?, ?)"
Using conn As New OleDbConnection(connString)
Using cmd As New OleDbCommand(sql, conn)
cmd.Parameters.AddWithValue("@FullName", fullName)
cmd.Parameters.AddWithValue("@Course", course)
cmd.Parameters.AddWithValue("@YearLevel", year)
cmd.Parameters.AddWithValue("@EnrollmentDate", DateTime.Now)
conn.Open()
Dim rows As Integer = cmd.ExecuteNonQuery()
MessageBox.Show($"{rows} row(s) inserted.")
End Using
End Using
End SubOleDb quirk: OleDb uses positional parameters with ? placeholders, not named ones. The parameter names you pass to AddWithValue are ignored for binding, only the order matters. Add parameters in the exact order the ? marks appear in your SQL. (SQL Server’s SqlCommand is the opposite, named parameters work there. Don’t confuse them.)
Read (SELECT): DataReader Approach
Use OleDbDataReader when you want to stream rows one at a time and process each one in code:
Private Sub LoadStudentsToListBox()
Dim sql As String = "SELECT StudentID, FullName, Course FROM tblStudents ORDER BY FullName"
Using conn As New OleDbConnection(connString)
Using cmd As New OleDbCommand(sql, conn)
conn.Open()
Using reader As OleDbDataReader = cmd.ExecuteReader()
lstStudents.Items.Clear()
While reader.Read()
lstStudents.Items.Add($"{reader("StudentID")} - {reader("FullName")} ({reader("Course")})")
End While
End Using
End Using
End Using
End SubRead (SELECT): DataAdapter Approach
Use OleDbDataAdapter when you want the whole result set in memory at once, perfect for binding to a DataGridView (covered in Step 5):
Private Function GetAllStudents() As DataTable
Dim sql As String = "SELECT * FROM tblStudents ORDER BY FullName"
Dim dt As New DataTable()
Using conn As New OleDbConnection(connString)
Using adapter As New OleDbDataAdapter(sql, conn)
adapter.Fill(dt)
End Using
End Using
Return dt
End FunctionNotice you don’t have to call conn.Open() explicitly, DataAdapter.Fill opens and closes the connection automatically.
Update (UPDATE)
Private Sub UpdateStudent(studentId As Integer, newCourse As String, newYear As Integer)
Dim sql As String = "UPDATE tblStudents SET Course = ?, YearLevel = ? WHERE StudentID = ?"
Using conn As New OleDbConnection(connString)
Using cmd As New OleDbCommand(sql, conn)
cmd.Parameters.AddWithValue("@Course", newCourse)
cmd.Parameters.AddWithValue("@YearLevel", newYear)
cmd.Parameters.AddWithValue("@StudentID", studentId)
conn.Open()
Dim rows As Integer = cmd.ExecuteNonQuery()
MessageBox.Show($"{rows} row(s) updated.")
End Using
End Using
End SubDelete (DELETE)
Private Sub DeleteStudent(studentId As Integer)
Dim confirm As DialogResult = MessageBox.Show(
$"Are you sure you want to delete student ID {studentId}?",
"Confirm Delete",
MessageBoxButtons.YesNo,
MessageBoxIcon.Warning)
If confirm <> DialogResult.Yes Then Return
Dim sql As String = "DELETE FROM tblStudents WHERE StudentID = ?"
Using conn As New OleDbConnection(connString)
Using cmd As New OleDbCommand(sql, conn)
cmd.Parameters.AddWithValue("@StudentID", studentId)
conn.Open()
Dim rows As Integer = cmd.ExecuteNonQuery()
MessageBox.Show($"{rows} row(s) deleted.")
End Using
End Using
End SubAlways confirm delete operations with a dialog. Accidental deletes in a capstone demo are not a story you want to tell your panel.
Step 5: Binding Data to a DataGridView
The DataGridView is the workhorse control of every VB.NET capstone, it’s how you show database rows on screen. The cleanest approach is to load data into a DataTable using OleDbDataAdapter.Fill, then assign the table to the grid’s DataSource property:
Private Sub LoadStudentsToGrid()
Dim sql As String = "SELECT StudentID, FullName, Course, YearLevel, EnrollmentDate " &
"FROM tblStudents ORDER BY FullName"
Using conn As New OleDbConnection(connString)
Using adapter As New OleDbDataAdapter(sql, conn)
Dim dt As New DataTable()
adapter.Fill(dt)
dgvStudents.DataSource = dt
End Using
End Using
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadStudentsToGrid()
End SubFor a more interactive setup, where you also want to navigate, filter, or sort the data programmatically, use a BindingSource as the middle layer between the DataTable and the grid:
Dim bs As New BindingSource()
Dim dt As DataTable = GetAllStudents()
bs.DataSource = dt
dgvStudents.DataSource = bs
' Now you can filter without re-querying the database:
bs.Filter = "Course = 'BSIT'"
' Or sort:
bs.Sort = "FullName ASC"After any INSERT, UPDATE, or DELETE, call LoadStudentsToGrid() again to refresh the grid. For a more advanced setup, use a DataSet with an OleDbCommandBuilder to auto-generate INSERT/UPDATE/DELETE SQL from a single SELECT, but for a typical capstone, the per-operation methods above are clearer and easier to debug.
Hiding columns: If you don’t want the StudentID column visible in the grid, set dgvStudents.Columns("StudentID").Visible = False after binding. Setting it before binding has no effect because the column doesn’t exist yet.

Optional: Use the Visual Studio Data Source Wizard
If you prefer Visual Studio’s drag-and-drop approach instead of writing the connection string by hand, the IDE has a built-in wizard. The steps below are the same workflow many capstone tutorials still teach. The wizard generates the same OleDb connection string under the hood, so you can switch back to the manual approach any time.
Wizard Step 1: Open “Add New Data Source”
On the Visual Studio menu, click Data then Add New Data Source.

Wizard Step 2: Choose Data Source Type
Select Database and click Next.

Wizard Step 3: New Connection
Click New Connection, then select Microsoft Access Database File and click Continue.

Wizard Step 4: Add Connection
Click Browse, locate your inventorydb.accdb, and click Open.

Wizard Step 5: Test Connection
Click Test Connection. You should see a “Test connection succeeded” message. If you get an error here, your ACE OleDb provider is not installed, jump to the “Common Connection Errors” section below.

Wizard Step 6: Copy the Generated Connection String
Visual Studio will show you the exact connection string it generated. Copy it, you can paste this same string into the connString variable in the code samples above instead of writing it from scratch.

Common Connection Errors and Fixes
Here are the errors every BSIT student hits at least once when wiring Access to VB.NET, with the exact fix for each.
Error: “The ‘Microsoft.ACE.OLEDB.16.0’ provider is not registered on the local machine”
Cause: The Access Database Engine isn’t installed, or the installed version is the wrong bitness.
Fix: Download Microsoft Access Database Engine 2016 Redistributable from Microsoft’s official site. Install the bitness that matches your VB.NET project’s Platform target. To check the target: Project → Properties → Build → Platform target. If it says x86, install the 32-bit redistributable. If it says x64 or Any CPU and you’re on 64-bit Windows, install the 64-bit redistributable.
Error: “Operation must use an updateable query”
Cause: The folder containing your .accdb file is read-only, or the file itself is marked read-only, or you’re running the app from a network share without write permission.
Fix: Move the .accdb file to a folder where your user account has full write access, C:\VBProjects\ works, C:\Program Files\ does not. Right-click the file → Properties → uncheck Read-only. If you’re shipping the app to other machines, never embed the .accdb under Program Files at install time, use %APPDATA% or %LOCALAPPDATA% instead.
Error: “Could not find installable ISAM”
Cause: Malformed connection string, usually a typo in the Provider name or missing quotation marks around the path.
Fix: Double-check the Provider spelling: Microsoft.ACE.OLEDB.16.0 (not Microsoft.Ace.OleDb.16, not Microsoft.ACE.OLEDB alone). Make sure the connection string uses semicolons between parts and ends with one. If your file path contains spaces, wrap it in " inside the VB string: "Data Source=""C:\My Files\students.accdb"";".
Error: “File path issues: works in Visual Studio but breaks when I distribute”
Cause: You hardcoded a path like C:\VBProjects\students.accdb that doesn’t exist on your panel/professor’s machine.
Fix: Use Application.StartupPath to build a path relative to where the .exe is running:
Dim dbPath As String = System.IO.Path.Combine(Application.StartupPath, "students.accdb")
Dim connString As String = $"Provider=Microsoft.ACE.OLEDB.16.0;Data Source={dbPath};"Then drop the .accdb file in the same folder as your .exe (typically bin\Debug\ or bin\Release\). Set the file’s Copy to Output Directory property in Solution Explorer to Copy if newer so it auto-copies on every build.
Error: “Permission denied” or “File is being used by another process”
Cause: The .accdb file is open in Microsoft Access, or another instance of your app still has it open, or a previous crash left an .laccdb lock file behind.
Fix: Close Microsoft Access completely. Check Task Manager and kill any stuck instances of your VB.NET app. Delete the .laccdb file in the same folder as your database (it’s a temporary lock file, safe to delete when no one is using the database). Always close your connection (use Using blocks) to prevent this in the future.
Error: “Data type mismatch in criteria expression”
Cause: You passed a string to a number field, a number to a date field, or forgot to use a parameter and concatenated values into SQL with the wrong quotes.
Fix: Use parameterized queries (every CRUD example above uses them). When you let OleDb handle the type conversion, mismatches become impossible. If you must concatenate (don’t), wrap dates in # signs: WHERE EnrollmentDate = #2026-06-18#, and don’t quote numbers.
Modern Alternatives for 2026: When NOT to Use Access
Access is great for capstones, single-user desktop tools, and small business apps where the data lives in one .accdb file and one user at a time touches it. It’s not the right pick for everything. Here’s a quick map of when to reach for something else:
- SQL Server Express (free): multi-user capstones, anything with concurrent writes, anything that might need to grow to client/server later. Same OleDb-ish style (use
SqlConnectionfromSystem.Data.SqlClientinstead). Free up to 10 GB per database. - SQLite: single-file like Access but cross-platform, faster on reads, and the .NET nuget package (
Microsoft.Data.Sqlite) works on .NET 8 with no driver install. Perfect for portable apps. - MySQL / MariaDB: if your capstone has a web front end (PHP, Node, etc.) alongside the VB.NET app, you’ll want a real server database. Use the
MySql.DataNuGet package on the VB.NET side. - Entity Framework Core: if you’re on .NET 8 and want to skip raw SQL entirely, EF Core gives you LINQ-to-database with full IntelliSense. It does not officially support Access, for EF, switch to SQLite or SQL Server.
For a typical BSIT capstone, a student records system, payroll, inventory, Access + VB.NET is still completely fine in 2026. Don’t over-engineer. See our VB.NET payroll system source code for a working example built on exactly this stack.
Related VB.NET Tutorials
Once you have Access connectivity working, here are the next two tutorials students usually look at:

Regular Expression in VB.NET
Validate inputs (emails, phone numbers, IDs) before saving to Access.
Export your Access query results to .xlsx for capstone reports.
Frequently Asked Questions
Official documentation
How do I connect MS Access database to VB.NET in 2026?
System.Data.OleDb, build a connection string using the Microsoft.ACE.OLEDB.16.0 provider, and call OleDbConnection.Open() inside a Try/Catch or Using block. The minimum connection string is Provider=Microsoft.ACE.OLEDB.16.0;Data Source=path\to\db.accdb;. You also need the Microsoft Access Database Engine 2016 Redistributable installed if Office isn’t on the machine.What is the connection string for .accdb in VB.NET?
Provider=Microsoft.ACE.OLEDB.16.0;Data Source=C:\path\to\file.accdb;. The 12.0 version of the provider also works and ships with the older Access Database Engine 2010 redistributable. For new projects in 2026, prefer 16.0, it’s the version Microsoft actively maintains.What is the difference between Microsoft.ACE.OLEDB.16.0 and Microsoft.Jet.OLEDB.4.0?
Microsoft.ACE.OLEDB.16.0 is the modern provider for .accdb files (Access 2007 and later), it supports both 32-bit and 64-bit. Microsoft.Jet.OLEDB.4.0 is the legacy provider for .mdb files (Access 97-2003) and is 32-bit only, it will fail to load in a 64-bit process. Use ACE for any new project; only use Jet if you’re working with old .mdb files and can’t convert them.Why am I getting “provider not registered on the local machine”?
How do I display Access data in a DataGridView using VB.NET?
OleDbDataAdapter to fill a DataTable with your SELECT query, then assign the table to dgvName.DataSource. Three lines of code: Dim adapter As New OleDbDataAdapter(sql, conn) / Dim dt As New DataTable() / adapter.Fill(dt) / dgvStudents.DataSource = dt. The adapter opens and closes the connection automatically. To refresh after a CRUD operation, just call your load method again.What is “Operation must use an updateable query” and how do I fix it?
Program Files to a writable folder like C:\VBProjects\ or %APPDATA%\YourApp\, and uncheck Read-only on the file itself.Can I use Access with VB.NET on .NET 8?
System.Data.OleDb namespace is available on .NET 8, install the System.Data.OleDb NuGet package (it isn’t included by default the way it is on .NET Framework). The provider name and connection string syntax are identical. Just make sure your project targets Windows (it should, since OleDb is a Windows-only API).Should I use OleDbCommand or OleDbDataAdapter?
OleDbCommand with ExecuteNonQuery() for INSERT, UPDATE, and DELETE, operations that don’t return rows. Use it with ExecuteReader() when you want to stream rows one at a time. Use OleDbDataAdapter with Fill() when you want the whole result set in memory at once, perfect for binding to a DataGridView. Both are right tools; they’re for different jobs.Is MS Access still good for capstone projects in 2026?
Final Recommendation
If you’re a BSIT or BSCS student building a capstone with VB.NET in 2026, the OleDb + Access combo is still the fastest path to a working demo. Start with the connection string pattern above, wrap every database call in a Using block, parameterize every query, and put Application.StartupPath-relative paths in your connection string so the app travels with the .exe. Once you have a working Form, the same pattern scales to as many tables as your capstone needs.
When you’re ready to grow past Access, multi-user, web front end, or you want to learn skills that transfer directly to industry, switch the connection string to SQL Server Express (the rest of your VB.NET code stays almost identical, just swap OleDb for SqlClient). That single architectural move is worth more than any extra feature you could add to the Access version.
🏆 Our 2026 pick for VB.NET capstones: Visual Studio 2022 Community + .NET Framework 4.8 (or .NET 8 if you’re feeling modern) + MS Access via OleDb with the ACE 16.0 provider + parameterized queries throughout. Total install time: 40 minutes. Total cost: $0.
- Build the StudentManager demo from this tutorial end-to-end, you’ll learn more than reading three more articles
- Browse working examples in our free VB.NET projects with source code
- See a complete VB.NET + Access app in action: Payroll System in VB.NET source code
- Need a capstone idea that fits this stack? See our 150 best capstone project ideas for IT students (2026 edition)
- Need a laptop that runs Visual Studio comfortably? See our 2026 laptop guide for programming students
- Browse all our VB.NET projects or the full VB.NET tutorial series
Stuck on a specific connection error? Drop the exact error message and your connection string (mask any passwords) in the comments, we’ll help you debug it.


thank you very much
zoom class?
wHAT IS & txtitemname.Text & .. YOU DIDNT DECLARED AMP.
Ali:-
yes he didn’t, but you will find the answer in the following of his youtubes
https://www.youtube.com/watch?v=d19592oQjdw
and I am very thankful to him
Thank you very much 👍
You know i did the exact thing, so when i run my project it displays this message “conversion from string Connected to type integer is not valid”
Please help