vb.net communication to ms acess database

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2006
Posts: 1
Reputation: kittooek1 is an unknown quantity at this point 
Solved Threads: 0
kittooek1 kittooek1 is offline Offline
Newbie Poster

vb.net communication to ms acess database

 
0
  #1
Aug 3rd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 57
Reputation: Exelio is an unknown quantity at this point 
Solved Threads: 0
Exelio Exelio is offline Offline
Junior Poster in Training

Re: vb.net communication to ms acess database

 
0
  #2
Aug 9th, 2006
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



Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC