Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What DBC is current DBF contained in ?
Message
De
04/09/2001 12:32:50
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00552066
Message ID:
00552130
Vues:
24
>>if open a table that is contained in a database (but i do not know
>>which one), is there a way to find out what the "containing database
>>pointer" is ?
>>
>>is there a way to update that pointer ?
>
>This will do it:
>if empty(dbf())
>   return ""
>endif
>local lcDBC, lnRetVal, llFound, lcCurDBC, laDBCs[1]
>lnRetVal = ADATABASES(laDBCs)
>lcCurDBC = SET('database')
>FOR EACH lcDBC IN laDBCs
>   SET DATABASE TO (lcDBC)
>   IF INDBC(JUSTSTEM(JUSTFNAME(DBF())), 'Table')
>      llFound = .t.
>      EXIT
>   ENDIF
>ENDFOR
>SET DATABASE TO (lcCurDBC)
>CLEAR
>if not llFound
>   lcDBC = ""
>endif
>RETURN lcDBC
mark -

thanks, that's what i need.

in between the time i posted and the time i got your recommendation,
i obtained ultra-edit and looked at the innards of a DBF. i could
see the name of the DBC listed there. and that raises a couple questions.

1) would you consider it bad form to use (for example) STRTOFILE / FILETOSTR
to modify the DBC info in a DBF ?

2) does the DBF have some kind of "checksum" value that i would need to
re-calculate and update, IF i did do such an alteration ??

3) is there already a utility to do that ? either from Microsoft or
someone here UT ?

i'm asking, because i do distributed systems and sometimes want to
move DBC and/or DBF files either separately or to directories that have
different names on the client than on the server. i don't want the users
to see a prompt to select the correct DBC if i can update it myself.
patrick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform