Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is a table part of a dbc? How to??
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00554114
Message ID:
00581812
Views:
25
>Sergey,
>
>I need to know database name without opening the table. How this program should be modified to return database name?
>
>Thanks a lot in advance.

Sorry, found in this thread the answer:
********************************************************************
*  Description.......: GetDBCName (without opening a table)
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Cetin Basoz
*  Modified by.......:
********************************************************************
lparameters tcTable
local Handle, lnLowByte, lnHighByte, lnBackLinkStart, lcDBCName
lcDBCName=""
Handle=fopen(m.tcTable)
if Handle>0
     =fseek(Handle,8,0) && Header size store pos - header()
     lnLowByte = asc(fread(Handle,1))
     lnHighByte = asc(fread(Handle,1))*256
     lnBackLinkStart = lnHighByte + lnLowByte - 263 && Backlink at header()-263
     =fseek(Handle,lnBackLinkStart,0)
     lcDBCName = fread(Handle,263)
     lcDBCName=left(m.lcDBCName,at(chr(0),m.lcDBCName)-1)
     =fclose(Handle)
endif
return m.lcDBCNam
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform