path of an opened dbf file.

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 2117
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 437 times
Been thanked: 95 times
Contact:

Re: path of an opened dbf file.

Post by serge_girard » Tue Mar 27, 2018 4:45 pm

Dominique,

This code is OK:

Code: Select all

use some_file
DirActual := GetCurrentFolder() + "\"
Filepath  := dbInfo(DBI_FULLPATH)
msginfo("File fullpath: " + DirActual + Filepath  )
 


But when you do:

Code: Select all

use c:\folder\some_file
DirActual := GetCurrentFolder() + "\"
Filepath  := dbInfo(DBI_FULLPATH)
msginfo("File fullpath: " + DirActual + Filepath  )
 


It will give twice pathnames!

Serge

dominique_devuyst
Posts: 11
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium
Has thanked: 10 times

Post by dominique_devuyst » Wed Mar 28, 2018 10:19 am

Hello Serge,

YES! It works.
But the currentfolder may not be the same as the file.
I will do like that :

Code: Select all

Actualpath := GetCurrentFolder() + "\"
FileName := Actualpath+"some_file"
use (FileName)
/*
.....
*/
Filepath  := dbInfo(DBI_FULLPATH)
So I'm sure it's the right one.

Thank you for your help,
Dominique

User avatar
serge_girard
Posts: 2117
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 437 times
Been thanked: 95 times
Contact:

Post by serge_girard » Wed Mar 28, 2018 10:23 am

Great !

Serge

Post Reply