path of an opened dbf file.

Issues and Discussions related to Harbour

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: path of an opened dbf file.

Post by serge_girard »

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
There's nothing you can do that can't be done...
dominique_devuyst
Posts: 22
Joined: Wed Dec 20, 2017 8:29 am
DBs Used: DBF
Location: Belgium

Re: path of an opened dbf file.

Post by dominique_devuyst »

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: 3166
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: path of an opened dbf file.

Post by serge_girard »

Great !

Serge
There's nothing you can do that can't be done...
Post Reply