Iowa Web Network

VB.NET – OleDbConnection Properties

Insert data using OleDbConnection Use ACE.OLEDB for databse connection (insert data) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As New OleDbConnection(“Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Projects\Northwind.accdb;Persist Security Info=False”) Dim CmdStr As String = “insert into sample _…

How to get GetConnectionString()

VB Public Shared Function GetConnectionString() As String Return ConfigurationManager.ConnectionStrings(“ConnectionString”).ToString() ‘ access properties ‘ if access driver is NOT installed on machine – most possible Return “Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\Projects\MyProject\DataSource\ProjectDB.accdb” ‘ if access driver is installed on machine Return…