Hi guys,
i'm having a difficulty to set the path in vb.net.i put the code in the module
and every time i run the code it throws error
"Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'."
here's the code

Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\Adigrat.accdb;Persist Security Info=False")

Are you sure the path is correct?

You can verify it by doing this:

If File.Exists("C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb") Then MsgBox("It is there!") Else MsgBox("Path May Be Wrong!")

My idea is that when you try to run the application on other pc how do you set the path?

Hi
Are you using a common networked database for all users? Or is it that you are deploying the database with the program i.e. one database per user?

commented: Forgot to ask! :) +8

A few things to check:

  • Is the file in the programs's Debug folder?
    C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\
  • If not, are you selecting 'Copy to Output'.

i just tested that it runs currently well.but i was just curious that i had a sample vb.net app that runs fine without putting the db in debug folder.anyway tnx a lot

This is how i have it in my visual basic code

dbconn.ConnectionString = (“Provider=Microsoft.ACE.OLEDB.12.0;Data Source=” & Application.StartupPath & “\eddybase.accdb”)
Now how can i locate that path on the client pc because there i wont install visual studio on his conputer. Just want to install the window application and work well while i can see the ms access database as eddybase.accdb in his local disk(c) let me say docunent or anywhere.
And am not using any network.
Just want to install on one pc not sharing the database