1,105,585 Community Members

linking database Microsoft Access with VB.NET

Member Avatar
lionheart84
Newbie Poster
1 post since Oct 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

How can i link database from microsoft access 2003 with VB.NET? can i use anything from eg. Form1 and display them on Form2? thx u very much.

Member Avatar
MaxDev
Newbie Poster
8 posts since Mar 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi,
This code is gonna connect to the Access database and load data into datagrid:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load

Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database Name.mdb"
Dim SQLString As String = "SELECT * FROM TableName"
Dim OleDBConn1 As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(ConnString)
Dim DataSet1 As New DataSet()
Dim OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(SQLString, OleDBConn1)
OleDBConn1.Open()
OleDbDataAdapter1.Fill(DataSet1, "TableName")
DataGridView1.DataSource = DataSet1.Tables("TableName")

End Sub

MaxDev

Member Avatar
fews4f
Newbie Poster
2 posts since Mar 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks, I will the code later.

Member Avatar
fews4f
Newbie Poster
2 posts since Mar 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks, I will try the code later.

Member Avatar
kavithabhaskar
Junior Poster
124 posts since Jun 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi:

I am newbie here. I keep getting this error most of the times. If any one of have come across it, please do share with me as to how you got rid of it.

error msg is as follows:

"visual studio cannot start debugging because the debug target (c:\....\filename.exe) is missing. Please build the project and retry r set the o/p path and assembly name properties to point the correct location of the target assembly"

Most of the times this message comes up. Sometimes 2 files would exist in the same folder but one would let me debug it but the other wont.

Thanks,
Kavitha.

Member Avatar
richboy
Newbie Poster
9 posts since Mar 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

.

Member Avatar
08bit058
Newbie Poster
2 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I dont know how to connect the visual basic dot net 2003 to connect with microsoft ms access 2003 so can u plz send me the codings

Member Avatar
killer88
Light Poster
42 posts since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hi ,
With this code we can link the database in ms access with vb.net. Now i have a question .
When we run the application made in vb.net, can we enter the data and store it in the database of MS access. ?

Member Avatar
kRod
Junior Poster
139 posts since May 2012
Reputation Points: 49 [?]
Q&As Helped to Solve: 35 [?]
Skill Endorsements: 6 [?]
 
0
 

Killer88 You might try doing some reading on database access in vb.net. There are many threads here on Daniweb and Google has thousands. Your question says you are trying to run before you can walk.
Click Here

Member Avatar
killer88
Light Poster
42 posts since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

kRod thanks man :)

Member Avatar
azareth
Posting Whiz in Training
247 posts since Apr 2012
Reputation Points: 5 [?]
Q&As Helped to Solve: 21 [?]
Skill Endorsements: 0 [?]
 
0
 

@killer88 yes.. and there are a lot of tutorials and sample codes on google and they're easy to find..

on that note, please read: http://www.daniweb.com/software-development/vbnet/threads/424836/please-read-this-before-posting

Use Search to see if your question has been asked and answered by another user.
Show us that you have made a serious effort (don't expect us to do the work for you).

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article