943,910 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 475
  • VB.NET RSS
May 10th, 2008
0

Need Help

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
deepukng is offline Offline
18 posts
since May 2008
May 11th, 2008
0

Re: Need Help

EASY

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
cmcontact.ExecuteNonQuery()
con.Close()


that is it my friend
Happy Coding
Reputation Points: 9
Solved Threads: 0
Light Poster
q8_dreamy is offline Offline
38 posts
since Apr 2008

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: RS232 File Transfer Problems
Next Thread in VB.NET Forum Timeline: Reference types





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


Follow us on Twitter


© 2011 DaniWeb® LLC