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?

Comments
Forgot to ask! :)

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 question has already been answered. Start a new discussion instead.