files on external drives
Moderator: Rathinagiri
files on external drives
Can you "USE" a data file off a different drive?
eg: ( If my installation is on C:\ drive )
A command like USE E:\BOOKS\AUTHORS.dbf
will not actually open the file. It can find it okay, so:
IF FILE("E:\BOOKS\AUTHORS.dbf")
USE E:\BOOKS\AUTHORS.dbf
ELSE
< Display some error message >
ENDIF
does not display the error message, but it does nothing!!
Any suggestions how to get round this?
Templar
eg: ( If my installation is on C:\ drive )
A command like USE E:\BOOKS\AUTHORS.dbf
will not actually open the file. It can find it okay, so:
IF FILE("E:\BOOKS\AUTHORS.dbf")
USE E:\BOOKS\AUTHORS.dbf
ELSE
< Display some error message >
ENDIF
does not display the error message, but it does nothing!!
Any suggestions how to get round this?
Templar
Re: files on external drives
Porque utilizar la letra de la unidad ?
Cuando ejecutas tu programa, asume que tus bases de datos se encuentran
en la carpeta (o tu le indicas las subcarpetas ) de donde está arrancando.
Si te fijas, todos los ejemplos de HMG,
NO UTILIZAN la letra de la unidad.
USE AUTHORS
Debería de ser suficiente.
*-------------------------------------------------------------------------------------------------
Why use the drive letter?
When you run your program, assume that your databases are
in the folder (or you indicate the subfolders) where it is booting from.
If you look, all the HMG examples,
DO NOT USE the drive letter.
USE AUTHORS
It should be enough.
Cuando ejecutas tu programa, asume que tus bases de datos se encuentran
en la carpeta (o tu le indicas las subcarpetas ) de donde está arrancando.
Si te fijas, todos los ejemplos de HMG,
NO UTILIZAN la letra de la unidad.
USE AUTHORS
Debería de ser suficiente.
*-------------------------------------------------------------------------------------------------
Why use the drive letter?
When you run your program, assume that your databases are
in the folder (or you indicate the subfolders) where it is booting from.
If you look, all the HMG examples,
DO NOT USE the drive letter.
USE AUTHORS
It should be enough.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: files on external drives
try to use
you can also use list of your locations separated by semicolon
You can also use SET DEFAULT TO [xcPatspec]
Sample from Clipper 5 manual:
Code: Select all
SET PATH TO E:\BOOKS
You can also use SET DEFAULT TO [xcPatspec]
Sample from Clipper 5 manual:
Code: Select all
set default to e:\books
? file("authors.dbf") //result: .T.
Re: files on external drives
Templar wrote: ↑Wed Mar 25, 2020 5:12 pm Can you "USE" a data file off a different drive?
eg: ( If my installation is on C:\ drive )
A command like USE E:\BOOKS\AUTHORS.dbf
will not actually open the file. It can find it okay, so:
IF FILE("E:\BOOKS\AUTHORS.dbf")
USE E:\BOOKS\AUTHORS.dbf
ELSE
< Display some error message >
ENDIF
does not display the error message, but it does nothing!!
Any suggestions how to get round this?
Templar
The simplest way is to use DbUseArea("e:\books\authors.dbf")
- AUGE_OHR
- Posts: 2065
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: files on external drives
hi,
you talk about external Drive ... is it a USB-Drive or Network-Drive
if USB-Drive : check Attribut if File have "R"eadonly Flag
can you open that DBF when copy to your Home-Directory.
you talk about external Drive ... is it a USB-Drive or Network-Drive
if USB-Drive : check Attribut if File have "R"eadonly Flag
can you open that DBF when copy to your Home-Directory.
have fun
Jimmy
Jimmy
- SALINETAS24
- Posts: 667
- Joined: Tue Feb 27, 2018 3:06 am
- DBs Used: DBF
- Contact:
Re: files on external drives
Hola Auge.., igual es esto lo que buscas.
Abrazos virtuales.., y vamos con la cervecita....
Code: Select all
cFile:="E:\BOOKS\AUTHORS.dbf"
IF FILE("E:\BOOKS\AUTHORS.dbf")
USE (cFile)
ELSE
< Display some error message >
ENDIF
Como dijo el gran pensador Hommer Simpson..., - En este mundo solo hay 3 tipos de personas, los que saben contar y los que no.
Re: files on external drives
Thanks to everyone for suggestions. Let me explain more.
I am writing a program to install my main package elsewhere. So first I copy all the necessary files from the C:\ drive onto the flashdrive at E:\. Then I want to open one of those files off the flashdrive.
Andyglezl: thanks, but I can't change the default, because I am still using files off C:\ as well.
Mol: Thanks but same thing. I need to use files off two different drives
Auge_ohr: Nope! Checked the Read Only flag. It isn't set
Salenitas24: Thanks, but actually I am enfolding it in a variable. I just simplified it for my example!
The file is certainly there: I can see it in File Explorer and the program checks it is there before trying to open it. So what happens is that it goes through "USE books.dbf" with no error message, but then "GO TOP" produces an error message: "Workarea not in use"
It's odd!
Templar
I am writing a program to install my main package elsewhere. So first I copy all the necessary files from the C:\ drive onto the flashdrive at E:\. Then I want to open one of those files off the flashdrive.
Andyglezl: thanks, but I can't change the default, because I am still using files off C:\ as well.
Mol: Thanks but same thing. I need to use files off two different drives
Auge_ohr: Nope! Checked the Read Only flag. It isn't set
Salenitas24: Thanks, but actually I am enfolding it in a variable. I just simplified it for my example!
The file is certainly there: I can see it in File Explorer and the program checks it is there before trying to open it. So what happens is that it goes through "USE books.dbf" with no error message, but then "GO TOP" produces an error message: "Workarea not in use"
It's odd!
Templar
- serge_girard
- Posts: 3178
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: files on external drives
Templar,
File is maybe corrupt?
Try another file.
Serge
File is maybe corrupt?
Try another file.
Serge
There's nothing you can do that can't be done...
Re: files on external drives
Try to prepare working sample producing error.
Some of us have a lot of time now...
Some of us have a lot of time now...