connecting to a dataabase in vb.net

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 2
Reputation: tau is an unknown quantity at this point 
Solved Threads: 0
tau tau is offline Offline
Newbie Poster

connecting to a dataabase in vb.net

 
0
  #1
Dec 12th, 2007
hi there i m having problems how do i connect to database in vb.net
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: connecting to a dataabase in vb.net

 
0
  #2
Dec 12th, 2007
specify database that u want to use. sql server, access, mysql, oracle, etc..
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2
Reputation: tau is an unknown quantity at this point 
Solved Threads: 0
tau tau is offline Offline
Newbie Poster

Re: connecting to a dataabase in vb.net

 
0
  #3
Dec 13th, 2007
how do i connect to0 an access database in vb.net
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: connecting to a dataabase in vb.net

 
1
  #4
Dec 13th, 2007
try this :
first you must made module to connect access to vb.net
add this following code in your module connected :

  1. Module MyModule
  2. Public Function Conection() As OleDb.OleDbConnection
  3. Dim con As OleDb.OleDbConnection
  4. con = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath.ToString & "\yourDatabaseName.mdb")
  5. Return con
  6. con = Nothing
  7. End Function
  8. End Module

after that you can call this module in your form code to connect with access db
ex :
Dim Connected = MyModule.Koneksi

then u can open connection (Connected .Open()) or close connection (Connected.close())

OK.
Hope this code helpfull
Last edited by Jx_Man; Dec 13th, 2007 at 5:03 am.
Reply With Quote Quick reply to this message  
Reply

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



Other Threads in the VB.NET Forum


Views: 1241 | Replies: 3
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC