943,987 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 3427
  • VB.NET RSS
Aug 3rd, 2006
0

vb.net communication to ms acess database

Expand Post »
Hi I m new to the VB.NET world. Please guide me with complete code as how can i connect to ms access database to VB.net form
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kittooek1 is offline Offline
1 posts
since Aug 2006
Aug 9th, 2006
0

Re: vb.net communication to ms acess database

hi,

Write the following code in form load event

Dim conn As New OleDb.OleDbConnection("Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDBatabase Locking Mode=1;Jet OLEDBatabase Password=;Data Source=C:\Program Files\Microsoft Office\Office10\Samples\Northwind.mdb;Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDBystem database=;Jet OLEDBFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Database=False;Jet OLEDBon't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False")
Dim da As New OleDb.OleDbDataAdapter("select * from orders", conn)
Dim ds As New DataSet
da.Fill(ds)

After filling the dataset, fill the contents to any source like listbox,datagrid.

For datagrid,
datagrid1.datasource=ds

Here i have used the existing Northwind database.Replace with your own database.

Hope you found this useful

Regards

Exelio



Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Crystal report
Next Thread in VB.NET Forum Timeline: Quotation Confusion





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC