Hello Friends,
I am learning VB.Net (Visual Studios 2005) and using MS Access as backend database. pls someone tell me how to connect VB.net to MS Access.


First, before defining the class write imports system.data.oledb

Second, inside your sub, you need to define a connection to the data base (for ex. Dim con as new oledbconnection)
then write the following:

con.ConnectionString = "provider=microsoft.jet.oledb.4.0; data source=C:\DB.mdb"

ofcourse instead of C:\DB.mdb you will write the drive where you saved the db and its name

then open your connection (con.open())

then define the command (dim cmcontact as new oledbcommand)
inside the command you will write the sql statement like insert to insert to the db also update or select

write the following 2 statements:

cmcontact.Connection = con

that is it my friend
Happy Coding