Database not found

emadmilan

New member
Joined
Jun 23, 2008
Messages
1
Programming Experience
Beginner
hi


when i try to connect to my database which is MS Access file i get this error
Could not find file 'C:\Users\Emad N. Alrwaily\Desktop\Sorting\Projects\WebSite1\MyDataBase.mdb'

and this hapen to my i put the connection string like this
VB.NET:
Dim StrCon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDataBase.mdb;"

but when i put the full path of the database directory it work like this
VB.NET:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Emad N. Alrwaily\Desktop\Sorting\WebSites\WebSite1\MyDataBase.mdb;"

please help
 
Hi

Not sure, but try "..\", like this

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\MyDataBase.mdb;"
 
Back
Top