How to Connect MS Acess Database to VB 2010

Hello guys,at this time i will show to you on how to connect a MS Access Database on 
Visual  Basic 2010, make sure that your database is inside of the Debug Folder created by 
Visual Basic 2010,then the codes will look like this:

Public Class Form1

 Dim con As New OleDb.OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;
Data Source = |DataDirectory|\Panoy.mdb;")

End Class

first you must establish the connection and set the Provider, to Microsoft.Jet.OLEDB.4.0,
and the Data Source, this is your Database Path or Directory, 

Note: |DataDirectory|\Panoy.mdb; this is your database correct path coonection
,|DataDirectory| is the replacement of App.Path on VB 6.0;

Happy Coding ^_^
The Hardest Thing to DO is to Do Nothing ^_^
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Reddit
  • Spurl
  • StumbleUpon
  • Technorati

Leave a comment

Copyright @ Codes-47.Blogspot.Com. Powered by Blogger.