Outside Computers

Monday, December 13, 2010

How to connect to a Database

Here is a sample code of how to connect to a database

this code is for microsoft access 2003

Imports system.Data.OleDb
Module Module1
    Public dbpath As String = Application.StartupPath + "\dbBilling.mdb"
    Public cnstring = "Provider = Microsoft.Jet.Oledb.4.0;Data Source =" & dbpath
    Public con As New OleDbConnection(cnstring)
End Module

No comments:

Post a Comment