views:

35

answers:

1

I have a database in the same workspace, I've tried to connect to this DB using this codes :

Dim CX As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "./Learning.mdb")

Dim CX As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "~/Learning.mdb")

Dim CX As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & "~Learning.mdb")

But none of them work.

+3  A: 

Try:

        Dim CX As OleDbConnection = New 
    OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" &
 System.AppDomain.CurrentDomain.BaseDirectory & "/Learning.mdb") 
JBrooks
I Love you man, Thank you very much.
dotNET