Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What DBC is current DBF contained in ?
Message
 
 
To
04/09/2001 11:05:30
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00552066
Message ID:
00552100
Views:
23
This message has been marked as the solution to the initial question of the thread.
>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 McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform