Connecting to access database

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
ManicCW ManicCW is offline Offline Sep 11th, 2006, 3:56 am |
0
Code for connecting to Microsoft Access databse, opening and closing connection
Quick reply to this message  
VB.NET Syntax
  1. Dim cn As New OleDbConnection
  2. cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Data.mdb;Persist Security Info=True"
  3. cn.Open()
  4. cn.Close()
0
dengbadeng dengbadeng is offline Offline | Feb 24th, 2008
hello sir. i tried that code but it doesn't work. it says that it's not defined. what should i do?
 
0
kavithabhaskar kavithabhaskar is offline Offline | Jul 18th, 2008
did you add a header to it ? add 'imports system.data.oledb' as the header and try
 
 

Message:


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