Click here to Skip to main content
16,021,125 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to connect database in vb using ms-access
Posted

Searching on the internet will give you millions of results.
The first result I got was this[^] and it seemed useful.
 
Share this answer
 
Google can help you without any doubt,and because CP is one of the most important sites that google use to bring solutions on programming to,i have use it to give you some codes that can help you.
VB
01	Imports System.Data.OleDb
02	Public Class DatabaseConnection
03	    Private CommonConnection As OleDbConnection
04	    Private CommaonDataAdapter As OleDbDataAdapter
05	    Private CommonCommand As OleDbCommand
06	    Private CommonDataSet As DataSet
07	 
08	    Public Sub New()
09	        CommonConnection = New OleDbConnection("provider=MicroSoft.jet.OLEDDB.4.0;" & "Data Source=..\db1.mdb;" & "persist Security Info=false")
10	        CommonCommand = New OleDbCommand
11	        CommonCommand.Connection = CommonConnection
12	        CommonDataSet = New DataSet
13	    End Sub
14	    Protected ReadOnly Property p_CommonConnection() As OleDbConnection
15	        Get
16	            Return CommonConnection
17	        End Get
18	    End Property
19	    Protected Property p_CommonDataAdapter() As OleDbDataAdapter
20	        Get
21	            Return CommaonDataAdapter
22	        End Get
23	        Set(ByVal Value As OleDbDataAdapter)
24	            CommaonDataAdapter = Value
25	        End Set
26	    End Property
27	    Protected ReadOnly Property p_CommonCommand() As OleDbCommand
28	        Get
29	            Return CommonCommand
30	        End Get
31	    End Property
32	    Protected Property p_CommonDataSet() As DataSet
33	        Get
34	            Return CommonDataSet
35	        End Get
36	        Set(ByVal Value As DataSet)
37	            CommonDataSet = Value
38	        End Set
39	    End Property
40	 
41	End Class
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900