| | |
connecting to a dataabase in vb.net
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
try this :
first you must made module to connect access to vb.net
add this following code in your module connected :
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
first you must made module to connect access to vb.net
add this following code in your module connected :
VB.NET Syntax (Toggle Plain Text)
Module MyModule Public Function Conection() As OleDb.OleDbConnection Dim con As OleDb.OleDbConnection con = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath.ToString & "\yourDatabaseName.mdb") Return con con = Nothing End Function 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.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: saving as .doc file
- Next Thread: migration problem..
Views: 1241 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application array assignment basic binary box button buttons center code connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net employees error excel exists firewall folder function image images isnumericfuntioncall listview login math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan peertopeervideostreaming picturebox plugin port print printing printpreview problem record refresh reports" reuse save savedialog search serial sorting sql sqldatbase storedprocedure string structures studio temp textbox timer upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml






