Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one database file "ABC.mdb" that is in DATABASE folder..This database folder is in Projects folder "Milkat"...Now what I need is,this MILKAT named folder can be placed on any drive..On Windows server 2003,The code I used runs perfect but when I copy on clients PC the same folder,error occurs saying "File not found".Below is the code to Find path of file and store it in variable..
VB
'If IO.File.Exists("..\..\Database\ABC.mdb") Then
        '    PathDB = "..\..\Database\ABC.mdb"
        'Else
        '    MsgBox("This path does not contain database.")
        '    Exit Sub
        'End If


Please help me..
Posted

1 solution

This error is caused by the use of relative paths, I suppose. Check if the relative path of the DB is the same on the client system and on the development folder.

cheers,
Marco Bertschi
 
Share this answer
 
Comments
Rachna0309 21-Mar-13 7:27am    
On development PC it is,E:\Projects\Database\ABC.mdb
and On Client system it is,C:\Milkat\Database\ABC.mdb
Marco Bertschi 21-Mar-13 7:29am    
And where is the executable located?
Rachna0309 21-Mar-13 7:31am    
On clients PC it is in C:\Milkat
On development it is in E:\Projects\bin
Rachna0309 21-Mar-13 7:36am    
Is there any better way to get path of file??
Marco Bertschi 21-Mar-13 7:37am    
The Problem is that your exe is located on different places related to the database on client and dev machine.
Changing the exe's location to C:\Milkat\bin on the client machine should you help solving the problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900