Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close DBC
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00598340
Message ID:
00598342
Views:
36
>I have a DBC open and try to close it in the following way but it remains open:
>
>tcDBCName = 'c:\path\Name.dbc' && CURDIR() is not c:\path
>* Note: the DBC is open
>IF DBUsed(JustStem(tcDBCName))
> SET DATABASE TO (JustStem(tcDBCName))
> CLOSE DATABASES
>ENDIF
>DELETE FILE ForceExt(tcDBCName,'DBC') && Error ocurrs because file is in use
>DELETE FILE ForceExt(tcDBCName,'DCT')
>DELETE FILE ForceExt(tcDBCName,'DCX')
>
>Thanks, Alex

I would presume it is because you SET DATABASE TO,
It will be closed, though the SET command will still have a reference to the file.
CLOSE DATABASES should close all tables and databases, not just the current one.
Try
SET DATABASE TO
when closing, (aswell as CLOSE DATABASES)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform