Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Agnes,
Sure.
First of all, JUSTSTEM() should be Justpath() .. sorry... ;-)
So, if justpath(tablename) is empty, I use the File() function.
Because the File() function DOES return true for included tables.
E.g. :
loTest = newobject("Opendbf","Opendll.dll")
loTest.c_Path = ""
loTest.c_Table = "alias"
if loTest.OpenDbf() = .T.
&&& Succes
endif
define class Opendbf as session
datasession = 1 &&& you want to open it in the calling-session
c_Path = ""
c_Alias = ""
c_Table = ""
c_Excl = ""
procedure init
with this
.c_Path = ""
.c_Alias = ""
.c_Table = ""
.c_Excl = ""
endwith
endproc
procedure OpenDbf
local llSucces
if file(this.c_Path + this.c_Table+".dbf") .or. (empty(this.c_Path) .and. file(this.c_Table+".dbf"))
llSucces = .T.
endproc
enddefine
Guillaume,
Having problems to understand your IF.
Is table the table you want to open? I don't understand how it could be with an empty file name? Could you post a larger piece of your code so that I have a better idea?
Agnes
>Hi Agnes,
>
>Well, suppose you had a DLL which does all the handling of opening tables for you. That way, you could use the DLL in all your applications.
>You only give it the full path, index, alias and so on.
>But, imagine you use the dll and suddenly, you want to open an included table.
>I solved it by using IF empty(juststem(table) .and. FILE(alias)
>That way, i get TRUE and I know it's included.
>
>Greetz
>
>Guillaume
>
>Hi Guillaume,
>
>why do you need to know that? I figured out that is very tricky to know that a file opend is included under all circumstances , but maybe a specific workaround will do. Anyway, all of may possible ideas will work after openning the table. But you can close it again?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement